SCP:如何找出复制说完后 [英] scp: how to find out that copying was finished

查看:126
本文介绍了SCP:如何找出复制说完后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用scp命令从一个Linux主机复制到另一个文件。
我跑在host1 SCP表彰和从主机1将文件复制到主机2。文件是相当大的,它需要一段时间来复制它。
在host2文件立即出现,只要复制已启动。我所能做的一切与此文件即使拷贝仍在进行中。

I'm using scp command to copy file from one Linux host to another. I run scp commend on host1 and copy file from host1 to host2. File is quite big and it takes for some time to copy it. On host2 file appears immediately as soon as copying was started. I can do everything with this file even if copying is still in progress.

有没有办法找出是否是抄袭host2上完成或没有任何可靠的方法?

Is there any reliable way to find out if copying was finished or not on host2?

推荐答案

关闭我的头顶,你可以这样做:

Off the top of my head, you could do something like:

touch tinyfile
scp bigfile tinyfile user@host:

然后当 tinyfile 看来你知道大文件的传输完成。

Then when tinyfile appears you know that the transfer of bigfile is complete.

由于在评论中指出,这是假定 SCP 将逐个复制文件,在指定的顺序。如果你不相信它,你可以通过我们明确地做他们之一:

As pointed out in the comments, this assumes that scp will copy the files one by one, in the order specified. If you don't trust it, you could do them one by one explicitly:

scp bigfile user@host:
scp tinyfile user@host:

这种方法的缺点是,你将可能不得不两次认证。如果这是一个问题,你可以使用类似 SSH -agent

这篇关于SCP:如何找出复制说完后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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