[HPADM] [SUMMARY] RE: SFTP Scripting
- From: "Roger Realsen" <roger.realsen@xxxxxxxxxxxxx>
- Date: Thu, 30 Nov 2006 10:32:15 -0800
Solved my problem by using "scp"
Thanks to all who supplied input.
1. Exchanged keys with partner
2. PUT FILE: "scp <local_dir><local_file>
<user>@<server>:<remote_dir><remote_file>"
3. GET FILE: "scp <user>@<server>:<remote_dir><remote_file>
<local_dir><local_file>"
Sincerely
Roger Realsen
From: hpux-admin-owner@xxxxxxxxxxxxx
[mailto:hpux-admin-owner@xxxxxxxxxxxxx] On Behalf Of Roger Realsen
Sent: Wednesday, November 29, 2006 3:08 PM
To: hpux-admin@xxxxxxxxxxxxx
Subject: SFTP Scripting
Gurus
HP 9000 rp3440-4
HPUX 11.11
BACKGROUND
We are trying to set up an SFTP environment with a partner. In this
communication we will be logging in to their SFTP server and getting and
putting different files. This routine needs to happen through run-time
Progress program in the middle of the night (basically like a CRON job).
We have installed SFTP on our UNIX box and have exchanged a public key
(id_rsa) with the partner.
I can successfully log in and do everything I need manually ... all I
need to now is to script it so it is non-interactive.
Manually I can do the following:
# sftp <user>@<server>
# <password>
# cd <directory>
# lcd <local_directory>
# get <filename>
# quit
Everything works out fine here. Now, after digging around the internet
and through the archives, I saw a couple of links and read as much as I
can understand. The script I am attempting to use is as follows:
Begin Script:
============================
# !/bin/sh
echo "Beginning test of scripted sftp ... "
sftp -b /dev/null <user>@<server> << EOF
cd <directory>
lcd <local_directory>
get <filename>
quit
EOF
Echo "Ending of test sftp script ... "
============================
End Script
When running the script using ...
# sh -x <script_file>
I get the following output ...
+ echo Beginning test of scripted sftp ...
Beginning test of scripted sftp ...
+ sftp -b /dev/null <user>@<server>
+ 0< /var/adm/sh534.1
+echo Ending of test sftp script ...
Ending of test sftp script ...
I am at a complete loss on what to do now. Can anyone lend a hand?
Sincerely
Roger Realsen
Roger Realsen | Director of IT | Wareforce | office: 949.452.1411 | fax:
949.452.1413 | roger.realsen@xxxxxxxxxxxxx
IM: TrendGod98 Yahoo: trendgod MSN: trendgod@xxxxxxx
"We make IT run better."
- References:
- [HPADM] SFTP Scripting
- From: Roger Realsen
- [HPADM] SFTP Scripting
- Prev by Date: [HPADM] RE: (SOLVED) RPC: Authentication error on HPUX 11.11
- Next by Date: [HPADM] Sendmail & Domain of Sender address does not exist
- Previous by thread: [HPADM] SFTP Scripting
- Next by thread: [HPADM] resdata failing
- Index(es):
Relevant Pages
|
|