-x option inoperative with "bind" mounts

2005-05-18 Thread Louis-David Mitterrand
Hello,

I have this mount defined in /etc/fstab:

/backup/current/usr/local/share/premier /var/www/g5/trunk/Naxos none bind,ro

When I backup /var with rsync using (among other) the -x option (one
filesystem) then the whole contents of
/backup/current/usr/local/share/premier are also backed up as they are
mounted on /var/www/g5/trunk/Naxos.

Is this expected behavior? I thought -x would exclude any mount,
including "bind" mounts.

Thanks,

-- 
"Faith strikes me as intellectual laziness." -- Robert A. Heinlein
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: -x option inoperative with "bind" mounts

2005-05-18 Thread Paul Slootman
On Wed 18 May 2005, Louis-David Mitterrand wrote:
> 
> I have this mount defined in /etc/fstab:
> 
> /backup/current/usr/local/share/premier /var/www/g5/trunk/Naxos none bind,ro
> 
> When I backup /var with rsync using (among other) the -x option (one
> filesystem) then the whole contents of
> /backup/current/usr/local/share/premier are also backed up as they are
> mounted on /var/www/g5/trunk/Naxos.
> 
> Is this expected behavior? I thought -x would exclude any mount,
> including "bind" mounts.

No, -x means "stay on this filesystem". You *are* on the same
filesystem...

This is determined by looking at the device number as returned by stat()
(on linux you may have the stat command that displays that info). That
corresponds to the block device on which the filesystem resides, and
that doesn't change with a bind mount.

You'd need to add an explicit --exclude for the bind mount point.
(Does the concept of "bind mount" exist on systems other than linux?)


Paul Slootman
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: -x option inoperative with "bind" mounts

2005-05-18 Thread Louis-David Mitterrand
On Wed, May 18, 2005 at 07:27:30PM +0200, Paul Slootman wrote:
> On Wed 18 May 2005, Louis-David Mitterrand wrote:
> > 
> > I have this mount defined in /etc/fstab:
> > 
> > /backup/current/usr/local/share/premier /var/www/g5/trunk/Naxos none bind,ro
> > 
> > When I backup /var with rsync using (among other) the -x option (one
> > filesystem) then the whole contents of
> > /backup/current/usr/local/share/premier are also backed up as they are
> > mounted on /var/www/g5/trunk/Naxos.
> > 
> > Is this expected behavior? I thought -x would exclude any mount,
> > including "bind" mounts.
> 
> No, -x means "stay on this filesystem". You *are* on the same
> filesystem...
> 
> This is determined by looking at the device number as returned by stat()
> (on linux you may have the stat command that displays that info). That
> corresponds to the block device on which the filesystem resides, and
> that doesn't change with a bind mount.
> 
> You'd need to add an explicit --exclude for the bind mount point.
> (Does the concept of "bind mount" exist on systems other than linux?)

Thanks for the clear explanation. I'll use excludes.

-- 
Every day is a gift, that's why the present is so named
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: -x option inoperative with "bind" mounts

2005-05-18 Thread Wayne Davison
On Wed, May 18, 2005 at 07:33:21PM +0200, Louis-David Mitterrand wrote:
> Thanks for the clear explanation. I'll use excludes.

Look in the support directory for the script mnt-excl for one way to
exclude mounts (and read the comments for a second way):

http://rsync.samba.org/ftp/unpacked/rsync/support/mnt-excl

..wayne..
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: -x option inoperative with "bind" mounts

2005-05-18 Thread Louis-David Mitterrand
On Wed, May 18, 2005 at 04:43:27PM -0700, Wayne Davison wrote:
> On Wed, May 18, 2005 at 07:33:21PM +0200, Louis-David Mitterrand wrote:
> > Thanks for the clear explanation. I'll use excludes.
> 
> Look in the support directory for the script mnt-excl for one way to
> exclude mounts (and read the comments for a second way):
> 
> http://rsync.samba.org/ftp/unpacked/rsync/support/mnt-excl

Indeed, this is a nice shortcut to automate things.

If the need to exclude all mounts has come to the point of writing such
a script, maybe a new option should be added to rsync? -X ? (like a big
serious X :-)

-- 
 "There are two major products that come out of Berkeley: LSD and BSD.
We don't believe this to be a coincidence." - Jeremy S. Anderson
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: -x option inoperative with "bind" mounts

2005-05-19 Thread Wayne Davison
On Thu, May 19, 2005 at 07:59:25AM +0200, Louis-David Mitterrand wrote:
> If the need to exclude all mounts has come to the point of writing such
> a script, maybe a new option should be added to rsync? -X ? (like a big
> serious X :-)

As mentioned in the script, the newest rsync supports absolute-path
exclusions via filter rules, so this isn't really needed in a newer
rsync.

..wayne..
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html