1827723 Members
2707 Online
109968 Solutions
New Discussion

Re: SFTP script

 
David Bellamy
Respected Contributor

SFTP script

Hello Gurus

I need a simple procedure to check if a file transfer using SFTP has completed successfully, can anyone help
1 REPLY 1
Steven E. Protter
Exalted Contributor

Re: SFTP script

Shalom,

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=899209

IP=ip_address
username=user
password=whatever
SOURCE=c:\files
DESTINATION=/tmp
FILE=myfile.dat

sftp << EOF
open $IP
$username
$password
lcd $SOURCE
cd $DESTINATION
put $FILE
bye
EOF



rc=$rc
if [ $rc -eq 0 ]
then
echo "File transfered"
echo "success"
else
echo "failed
fi

Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com