あるサーバーから別のサーバーへのファイル転送または FTP を自動化しようとしています。
#!/bin/bash
### In this model, the same filename is processed on each run.
### A timestamp is added to the result file and data file is copied to the archive or error folder with a timestamp after processing.
# Set current directory
cd `dirname "$0"`
# Set the environment variables
. ./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
exit $?
このシェル スクリプトを実行すると、 putty で次のエラーが発生します。
-bash: sshpass: command not found
および他の手順で ssh パスワードなしの方法を使用してみました ssh-keygen -t dsa
が、次の手順を実行できないため、2 番目のサーバーのパテにアクセスできません。
親切に助けて