rsync filters

Johnny Rosenberg gurus.knugum at gmail.com
Thu Sep 24 17:19:47 UTC 2009


2009/9/24 Hal Burgiss <hal at burgiss.net>:
> 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.

Well, I can see below that you use the --delete-excluded option. This
option deletes the target directories that's listed in your list of
excluded directories, using the --exclude-from option. But as far as I
can see you don't have one, BUT maybe the F option works the same way
in this matter?

J.R.

>
> 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
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>




More information about the ubuntu-users mailing list