我正在使用以下脚本,但无法将文件从一台Linux服务器传输到另一台Linux服务器。请帮助我。
#!/bin/ksh
cd /local_server/directory1 #Local server directory
sftp -oIdentityFile="/home/user/.ssh/id_rsa" usr_lnx@servername #SFTP to remote server
cd /remote_server/directory1 #Remote server directory
CURRENT_DATE=`date "+%Y%m%d"` #Getting the files with date
PUT *$CURRENT_DATE*.zip #Sending files which matches today's date
exit 0