linux – 为什么rsync会为我生成多个进程?

linux – 为什么rsync会为我生成多个进程?,第1张

概述我使用以下cron语句从一个文件夹备份到同一台机器中的另一个文件夹: 19 21 * * * root rsync -ac --delete /source/folder /dest/folder 当我使用pstree时,我看到cron分叉了三个进程 ├─cron───cron───rsync───rsync───rsync 和ps 9972 ? Ds 1:00 rsync 我使用以下cron语句从一个文件夹备份到同一台机器中的另一个文件夹:
19 21 * * * root  rsync -ac --delete /source/folder /dest/folder

当我使用pstree时,我看到cron分叉了三个进程

├─cron───cron───rsync───rsync───rsync

和ps

9972 ?        Ds     1:00 rsync -ac --delete /source/folder /dest/folder 9973 ?        S      0:29 rsync -ac --delete /source/folder /dest/folder 9974 ?        S      0:09 rsync -ac --delete /source/folder /dest/folder

为什么有三个流程?我可以只限一个吗?

解决方法 http://rsync.samba.org/how-rsync-works.html

Rsync is heavily pipelined. This means that it is a set of processes that communicate in a (largely) unIDirectional way. Once the file List has been shared the pipeline behaves like this:
generator → sender → receiver

The output of the generator is input for the sender and the output of the sender is input for the receiver. Each process runs independently and is delayed only when the pipelines stall or when waiting for disk I/O or cpu resources.

您正在运行本地rsync(源和目标是本地文件系统),因此所有三个进程都将在那里运行.你无能为力,这是设计的.

总结

以上是内存溢出为你收集整理的linux – 为什么rsync会为我生成多个进程?全部内容,希望文章能够帮你解决linux – 为什么rsync会为我生成多个进程?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1044838.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存