我使用以下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 → 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(源和目标是本地文件系统),因此所有三个进程都将在那里运行.你无能为力,这是设计的.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。