Shell :利用 sshpass 远程传输文件
程序员文章站
2022-07-14 09:29:21
...
#!/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/