samba-bugs@samba.org
2004-Jun-10 22:22 UTC
[Bug 1455] Make -x skip a "bind" mount point to the same filesystem
https://bugzilla.samba.org/show_bug.cgi?id=1455 wayned@samba.org changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement Status|NEW |ASSIGNED Priority|P3 |P4 Summary|mount --bind is ignored by -|Make -x skip a "bind" mount |x |point to the same filesystem ------- Additional Comments From wayned@samba.org 2004-06-10 15:10 ------- Since the bla/lib dir is on the same partition as bla, there is no way for the current rsync algorithm to notice any difference (the stat() call shows no change because the files dirs are actually on the same filesystem). It might be possible to do something like transform a mount list into an exclude list, but only if it could be done portably (e.g. by using getfsent(), getmntent(), or whatever is available). In the meantime I've changed this bug to an enhancement request. Your best bet for a quick fix is to use some explicit excludes. One way is to use a perl script to automatically create an exclude list from the /proc/mounts file, like this one (name this "mntexcl"): #!/usr/bin/perl -w use strict; my $start_dir = shift; $start_dir =~ s#^([^/])#$ENV{'PWD'}/$1#; my($prefix, $suffix) = $start_dir =~ m#^(.*/)([^/]*)$#; open(IN, '/proc/mounts') or die $!; while (<IN>) { $_ = (split)[1]; next unless s#^\Q$prefix\E##o && $_ ne ''; next if $suffix ne '' && !m#^\Q$suffix\E/#o; print "/$_\n"; } close IN; You could feed this into rsync like this (specifying the starting directory to mntexcl so that it can properly trim the excludes): mntexcl /www/ | rsync --exclude-from=- ... /www/ /backup/daily.0/www/ -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
samba-bugs@samba.org
2004-Jun-10 22:42 UTC
[Bug 1455] Make -x skip a "bind" mount point to the same filesystem
https://bugzilla.samba.org/show_bug.cgi?id=1455 ------- Additional Comments From wayned@samba.org 2004-06-10 15:35 ------- Created an attachment (id=542) --> (https://bugzilla.samba.org/attachment.cgi?id=542&action=view) Improved mntexcl perl script A few minor improvements to the in-line script mentioned in comment #1. This script expects /proc/mounts to exist, but could be easily adapted to read /etc/mtab or similar. -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.