如何使用部分复制的文件恢复scp? [英] How to resume scp with partially copied files?

查看:228
本文介绍了如何使用部分复制的文件恢复scp?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用scp shell命令复制巨大的文件文件夹.

I use scp shell command to copy huge folder of files.

但是在某些时候,我不得不终止正在运行的命令(通过Ctrl + C或终止).

But at some point of time I had to kill the running command (by Ctrl+C or kill).

据我所知,scp是按顺序复制文件的,因此应该只有一个部分复制的文件.

To my understanding scp copied files sequentially, so there should be only one partially copied file.

如何恢复相同的scp命令以不覆盖成功复制的文件并正确处理部分复制的文件?

P.S.我知道我可以在rsync中执行这种操作,但是由于某种原因,scp对我来说速度更快,我改用它.

P.S. I know I can do this kind of stuff in rsync, but scp is faster for me for some reason and I use it instead.

推荐答案

您应在ssh

rsync -P -e ssh remoteuser@remotehost:/remote/path /local/path

关键选项是 -P ,与--partial --progress

还可以使用其他选项,例如-a(用于存档模式)和-z(用于启用压缩).

Other options, such -a (for archive mode), and -z (to enable compression) can also be used.

手册: https://download.samba.org/pub/rsync/rsync .html

这篇关于如何使用部分复制的文件恢复scp?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆