无法在NFS文件夹之间复制大量文件

发布于 2025-02-09 12:28:43 字数 473 浏览 0 评论 0原文

我正在尝试使用Linux的rsync命令在Python3中复制2个NFS安装量之间的巨大文件(370 GB):

file_src = "/mnt/nfs1/file1.zip"
file_dst = "/mnt2/nfs2/"
subprocess.call(["rsync", "-avu", "--progress", "--whole-file", file_src, file_dst])

几个小时后,我在日志中看到了:

373,621,623,053 100%   27.78MB/s    3:33:45 (xfr#1, to-chk=0/1)

但是当我转到DST文件夹时, file_dst不存在。

该程序也被杀(无原木)。

为什么文件未复制?有没有更好的方法可以使用Linux/Python复制文件?

I'm trying to copy huge file (370 GB) between 2 NFS mounts using linux's rsync command in python3:

file_src = "/mnt/nfs1/file1.zip"
file_dst = "/mnt2/nfs2/"
subprocess.call(["rsync", "-avu", "--progress", "--whole-file", file_src, file_dst])

and after few hours I saw in the logs:

373,621,623,053 100%   27.78MB/s    3:33:45 (xfr#1, to-chk=0/1)

But when I go to the dst folder, the file_dst doesn't exists.

Also the program killed (without logs).

Why the file isn't copied? Is there a better way to copy the file using linux/python?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤城病女 2025-02-16 12:28:43

你发表了评论

但是当我转到DST文件夹时,File_dst不存在。

这表明您不知道

/mnt/nfs2/

远程路径末端的“/”表单告诉RSYNC期望NFS2已经存在,并且不会创建该目录。

如果删除该尾声“/”,则将创建目录NFS2。

当Rsync将传输缓冲区填充到最大限制时,它可能会失败,而无需通过在遥控器上写入磁盘来空。

You made the comment

But when I go to the dst folder, the file_dst doesn't exists.

That suggest that you are not aware that the form

/mnt/nfs2/

with the "/" at the end of the remote path tells rsync to expect nfs2 to exist already, and will not create that directory.

If you remove that trailing "/", the directory nfs2 will be created.

rsync probably failed when it filled the transfer buffer to the max limit without being able to empty by writing to disk on the remote.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文