centos7 shell脚本批量上传文件
!/bin/bash
file=log.txt
HOST=172.16.16.11
USER=zhangsan
PASSWORD=123456
remote_path=/data/Log
local_path=/home/Log
echo "welcome to sftp..."
lftp -u ${USER},${PASSWORD} sftp://${HOST}<<EOF
cd ${remote_path}
lcd ${local_path}
put ${file}
echo
bye
EOF
lftp的命令可能没有
yum -y install lftp
现在学习还不晚;