I am trying to automate the transfer of files or FTP from one server to another.
A timestamp is added to the result file and data file is copied to the archive or error folder with a timestamp after processing.
cd `dirname "$0"`
. ./Environment.sh $0
FILE=/hcm/Inbound/file.csv
sshpass -p 'xyz' sftp -oBatchMode=no -b - -oStrictHostKeyChecking=no zys@192.abc.taleo.net <<_EOF_
cd /upload/
put $FILE
_EOF_
exit $?
When I execute this shell script, I get the following error in putty:
-bash: sshpass: command not found
I tried using an ssh password without a method ssh-keygen -t dsaand other steps, but I canβt access the putty of the second server, because of which I canβt complete the following steps.
Request for help
source
share