Don't follow bind mounts?

Carl Brewer carl at
Wed May 15 18:52:09 MDT 2013

The manual says that rsync treats bind mounts on UNIX (Linux) to the 
same filesystem as being on the same filesystem.

I have a server with a pile of bind mounts to the same filesystem for 
some access control/ease of use for FTP users modifying websites.  This 
makes my backups using rsync messy!

Is there any way to stop rsync from following bind mounts to the same 
filesystem?  Short of unmounting them all at backup time and remounting 
afterwards or explicitly excluding each one?  -x -x seemed hopeful, but 
it didn't stop following the mount and I ended up with two copies (or 
more!) of the data on my backup server.   Googling just takes me to the 
man page saying "no", in a roundabout sort of way. I found this :

Which never made it into rsync, it seems (didn't work?) and the script 
mnt-excl suggests that it is redundant for rsync >= 2.6.4.  any examples 
of use of :

awk '{print $2}' /proc/mounts | rsync -f 'merge,/- -' host:/dir /dest/

around with some details of its use for backups?

Thank you


More information about the rsync mailing list