Rsync不删除

发布于 2024-12-11 12:53:36 字数 1459 浏览 0 评论 0原文

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

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

发布评论

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

评论(2

沩ん囻菔务 2024-12-18 12:53:36

我可以通过使用以下方法来解决此问题:

rsync -vhzrplt --stats --delete --rsh='/usr/bin/ssh -q'  --exclude="core/" --exclude="cache/" /home/(a)/public_html/ (b):/home/(b)/public_html/

向文件夹路径添加尾部斜杠。

I was able to fix this by using this instead:

rsync -vhzrplt --stats --delete --rsh='/usr/bin/ssh -q'  --exclude="core/" --exclude="cache/" /home/(a)/public_html/ (b):/home/(b)/public_html/

Add trailing slashes to paths that are folders.

酒解孤独 2024-12-18 12:53:36

rsync 有大量选项 - 请参阅 man rsync

例如:

--del                   an alias for --delete-during
--delete                delete extraneous files from dest dirs
--delete-before         receiver deletes before transfer (default)
--delete-during         receiver deletes during xfer, not before
--delete-delay          find deletions during, delete after
--delete-after          receiver deletes after transfer, not before
--delete-excluded       also delete excluded files from dest dirs

确实建议仔细阅读该手册页,因为有很多有用的选项。

rsync has tons of options -- see man rsync

e.g.:

--del                   an alias for --delete-during
--delete                delete extraneous files from dest dirs
--delete-before         receiver deletes before transfer (default)
--delete-during         receiver deletes during xfer, not before
--delete-delay          find deletions during, delete after
--delete-after          receiver deletes after transfer, not before
--delete-excluded       also delete excluded files from dest dirs

It's really recommended to read that man page thoroughly because there are so many useful options.

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