有没有办法在 Linux 中继续损坏的 scp(安全复制)命令进程?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20860896/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there a way to continue broken scp (secure copy) command process in Linux?
提问by Matko
I am copying 7.5 GB file to a remote server using scpcommand. At some point in time file transfer breaks and I have to start all over again.
我正在使用scp命令将 7.5 GB 文件复制到远程服务器。在某个时间点文件传输中断,我必须重新开始。
Is the temporary amount of file being transferred completely lost ? Can I somehow restart the transfer from where it has stopped at previous attempt ? If not, is there some standard Unix command line file transfer command for doing that ?
正在传输的临时文件量是否完全丢失?我可以以某种方式从上次尝试停止的地方重新开始传输吗?如果没有,是否有一些标准的 Unix 命令行文件传输命令可以做到这一点?
采纳答案by Tom McClure
If you need to resume an scp transfer from local to remote, try with rsync:
如果您需要恢复从本地到远程的 scp 传输,请尝试使用 rsync:
rsync --partial --progress --rsh=ssh local_file user@host:remote_file
Short version, as pointed out by @aurelijus-rozenas:
正如@aurelijus-rozenas 指出的那样,简短版本:
rsync -P -e ssh local_file user@host:remote_file
In general the order of args for rsync is
一般来说,rsync 的 args 顺序是
rsync [options] SRC DEST
回答by DigitalRoss
This is all you need.
这就是你所需要的。
rsync -e ssh file host:/directory/.