rsync filters

Hal Burgiss hal at burgiss.net
Thu Sep 24 16:33:24 UTC 2009


I want to sync/mirror various directories between 2 servers. I want to exclude
most of the system specific stuff. But the stuff to be synced is significant and
it is scattered here and there. I am trying to use the -F switch with an
/.rsync-filter file to exclude what I don't want synced. The servers in
question are pretty much identical 8.04 installations, even the hardware.

I have 2 problems with this: the same syntax seems to work for some directories but
not others. Secondarily, it seems to find things that are identical, and rsync
seems to want to delete them. In many cases these are system files like
/dev/tty*. 

So in /.rsync-filter I have statements like: 

- /usr/*
- /bin/*
- /boot/*
- /dev/*
- /initrd
- /lib/*
- /media/*
- /mnt/
- /opt/*
- /proc/*
- /sbin/*
- /srv/*
- /sys/*
- /tmp/*
- initrd.img
- /vmlinuz/*
- /cdrom/*
- /raid/*
- /proc/*
- /var/*
- /etc/*

Mostly this works as expected, but not for /etc/, /bin,/dev/, or /proc. I've
tried variations on '*' or not '*'. It helps in some cases and not others. 

For instance, I get this kind of output ...

bin/
deleting bin/znew
deleting bin/zmore
deleting bin/zless
deleting bin/zgrep
deleting bin/zforce
deleting bin/zfgrep
deleting bin/zegrep
deleting bin/zdiff
deleting bin/zcmp
deleting bin/zcat
deleting bin/which
deleting bin/vdir
deleting bin/uncompress
deleting bin/uname
deleting bin/umount
[...]

All of which exist on both machines and appear to be identical, including 
timestamps.

And then later ...

sbin/
srv/
sys/
tmp/
usr/
var/

So those latter ones are properly ignored. I am running in --dry-run mode, so
its harmless at this point, but I can't find the magic words to make this
stuff work. 

The command line I am using is: 
rsync  -vazSHF --no-blocking-io --partial --delete-during --delete-excluded --timeout 600 --dry-run  / $sync_dst:/

Thx.

-- 
Hal




More information about the ubuntu-users mailing list