On 01/13/2011 06:14 PM, Wayne Davison wrote:
On Thu, Jan 13, 2011 at 10:24 AM, Jeff Hansen <[email protected] <mailto:[email protected]>> 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..
I'm really just trying to make things easier on everybody; i.e. avoid having to use scripts to do simple things. It seems like adding some sort of a flag to get this functionality would benefit everyone more than pointing them to an awk script that may or may not be readily available/usable.

Either that, or we should fix the '-x' flag so that it actually does what it purports to do -- stay on *one* file system. Conceptually, I would not consider a bind mount the "same" file system, especially wrt backups.

-Jeff

--
**** ////Jeff Hansen
////Card Access, Inc.//
//11778 So. Election Rd., Ste. 260//
//Salt Lake City, UT 84020//
//[email protected]// <mailto:[email protected]>
//www.CardAccess-inc.com <http://www.cardaccess-inc.com/>//
//801-748-4900 ext 26 (Office)//
//801-748-4901 (fax)//

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to