This patch allows one to repeat the '-x' option a third time to stop rsync from traversing potentially cyclic bind mounts that are on the same filesystem. For example, the following scenario would cyclically traverse the bind mounts until the OS (Linux in this case) hits a maximum traversal count, thank goodness. Other OSes may traverse the bind mount indefinitely... su cd mkdir ~/cycle touch ~/cycle/file.txt mkdir ~/cycle/cycle mount -o bind ~/cycle ~/cycle/cycle rsync -avxx ~/cycle ~/cycle2 Please let me if there is any feedback on this patch and when/if this patch can be merged. Thanks! -Jeff -- //Jeff Hansen ////Card Access, Inc.// //11778 So. Election Rd., Ste. 260// //Salt Lake City, UT 84020// //JHansen at CardAccess-inc.com// <mailto:JHansen at CardAccess-inc.com> //www.CardAccess-inc.com <http://www.cardaccess-inc.com/>// //801-748-4900 ext 26 (Office)// //801-748-4901 (fax)// -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20110113/1b9cb3c1/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: rsync-3.0.7-one-file-system.patch Type: text/x-patch Size: 2549 bytes Desc: not available URL: <http://lists.samba.org/pipermail/rsync/attachments/20110113/1b9cb3c1/attachment.bin> -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5622 bytes Desc: S/MIME Cryptographic Signature URL: <http://lists.samba.org/pipermail/rsync/attachments/20110113/1b9cb3c1/attachment-0001.bin>
Matt McCutchen
2011-Jan-13 18:49 UTC
[PATCH] One more -x to not traverse cyclic bind-mounts
On Thu, 2011-01-13 at 11:24 -0700, Jeff Hansen wrote:> This patch allows one to repeat the '-x' option a third time to stop > rsync from traversing potentially cyclic bind mounts that are on the > same filesystem.Your patch does not do anything about bind mounts, it simply excludes subdirectories of the source arguments. Try it and see. -- Matt
Wayne Davison
2011-Jan-14 01:14 UTC
[PATCH] One more -x to not traverse cyclic bind-mounts
On Thu, Jan 13, 2011 at 10:24 AM, Jeff Hansen <jhansen at cardaccess-inc.com>wrote:> This patch allows one to repeat the '-x' option a third time to stop rsync > from traversing potentially cyclic bind mounts that are on the same > filesystem. >See the support/mnt-excl script for one way exclude all mounts (including bind mounts) from an rsync. The script also recommends an awk command piped into an absolute-anchored exclude, but does get some of the details wrong. Here's a better explanation: awk '{print $2}' /proc/mounts | rsync -avf 'merge,/- -' /dir host:/dest/ The above will get a list of all mount points on the system and use it as an exclude list to prevent any mounts from being traversed. However, what it will not do is to protect the related mount points on the receiving side from deletion unless you happen to be copying into an exactly-the-same path on the destination. If you want the excluded directories to be protected on the receiving side, you're better off using the mnt-excl script (which tweaks the excludes to be relative to the transfer). ..wayne.. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20110113/fd085209/attachment.html>
Possibly Parallel Threads
- package mgcv inconsistency in help files? cyclic P-spline "cs" not cyclic?
- cyclic namespace dependency detected
- cyclic dependency error
- cyclic namespace dependency detected when loading ...
- [LLVMdev] Cyclic dependencies while building llvm shared libraries using CMake