scp

万能脚本

从远程服务器下载文件到本地

[root@localhost ~]# more scp-html.sh
#!/bin/bash
wenjian=`date +%Y-%m-%d`
scp -P 1221 -r root@1.94.39.166:/root/back/$wenjian*.gz /mnt/hgfs

[root@localhost ~]# more scp-sql.sh
#!/bin/bash
wenjian=`date +%Y-%m-%d`
scp -P 1221 root@1.94.39.166:/root/back/$wenjian*.sql /mnt/hgfs

把本地文件上传到服务器

scp -P 1221 /root/OneShellScript.sh root@1.94.39.166:/var/www/html/ShellScript/
THE END
点赞13 分享