SCP
从 本地 复制到 远程
1 | scp local_file remote_username@remote_ip:[remote_folder|remote_file] |
从 远程 复制到 本地
1 | scp remote_username@remote_ip:[remote_folder|remote_file] local_file |
具体可以参考:https://www.runoob.com/linux/linux-comm-scp.html
scp断点续传
scp 是通过ssh协议传输数据,如果是想传输一个很大的数据,有可能遇到连接中断等问题又要重新上传的悲剧。通过类似scp
拷贝的另一个命令rsync
就可以实现意外中断后,下次继续传输,命令如下:
1 | rsync -P --rsh=ssh local_file remote_username@remote_ip:remote_folder |
-P: 是包含了
–partial –progress
, 部分传送和显示进度-rsh=ssh 表示使用ssh协议传送数据
1 | # 这里举个例子,从远程拷贝数据库信息到本地数据库 |
本文作者:
ionluo
本文链接: http://www.ionluo.cn/blog/posts/59a8f40b.html
版权声明: 本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。转载请注明出处!
本文链接: http://www.ionluo.cn/blog/posts/59a8f40b.html
版权声明: 本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。转载请注明出处!