Shell :利用 sshpass 远程传输文件

#!/bin/sh

sshpass -p "$4" ssh $3@$1 -p $2 << EOF
if [ ! -d "/srv/jianfei/portal_project/adplatform/storage/" ]; then
mkdir -p /srv/jianfei/portal_project/adplatform/storage/
fi
exit
EOF

sshpass -p "$4" scp -P $2 -o StrictHostKeyChecking=no -r /root/workspaces/storage/* $3@$1:/srv/jianfei/portal_project/adplatform/storage/

你可能感兴趣的:(shell,scp,sshpass)