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.htmlRsync 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 → receiverThe 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会为我生成多个进程?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)