I have looked on the mailing lists and through rsync documentation but those still haven't solved my problem. I may be calling rsync incorrectly but the problem I have is that the exclude file seems to be ignored. My final goal is to replicate an entire host, excluding some files that contain specific IP, hostname configuration things. I'm trying to start small by mirroring a directory first and then later I will just specify "/". I'm running rsync on the destination so that my rsync configuration is on that box but may be I should switch it? Here is the command line I'm using. rsync -avv -n --delete --exclude-from=sys_dont_replicate.list -e ssh root@patron:/etc/ /etc here is some sample output ====================opening connection using ssh -l root patron rsync --server --sender -vvnlogDtpr --delete . /etc/ receiving file list ... expand file_list to 4000 bytes, did move expand file_list to 8000 bytes, did move expand file_list to 8000 bytes, did move done expand file_list to 4000 bytes, did move expand file_list to 8000 bytes, did move done deleting in . deleting cron.d/replication .java/.systemPrefs/.systemRootModFile adjtime aliases.db cron.d/webmin_update fstab fstab.REVOKE hosts ioctl.save kde/kdm/kdmsts lilo.conf mail/statistics modules.conf motd mtab ntp/drift printcap printcap.old resolv.conf samba/secrets.tdb shadow sudoers sysconfig/hwconf sysconfig/network sysconfig/network-scripts/ifcfg-eth0 sysconfig/network-scripts/ifcfg-eth1 total: matches=0 tag_hits=0 false_alarms=0 data=0 wrote 382 bytes read 39763 bytes 80290.00 bytes/sec total size is 4450769 speedup is 110.87 exclude file sys_dont_replicate.list =======================/etc/cron.d/replication /etc/hosts /etc/lilo.conf /etc/motd /etc/ssh/* /etc/sysconfig/hwconf /etc/sysconfig/network /etc/sysconfig/network-scripts/ifcfg-eth0 /proc/* /replication/* /root/.bash_profile /root/.ssh/* /tmp/* /usr/backup/* /var/log/* rsync version 2.5.4 protocol version 26 Running on RH v7.3
On Mon, 21 Mar 2005, Lars Nordin <lnordin@noblesys.com> wrote:> I have looked on the mailing lists and through rsync documentation but those > still haven't solved my problem. I may be calling rsync incorrectly but the > problem I have is that the exclude file seems to be ignored. My final goal is > to replicate an entire host, excluding some files that contain specific IP, > hostname configuration things. I'm trying to start small by mirroring a > directory first and then later I will just specify "/".<snip>> Here is the command line I'm using. > > rsync -avv -n --delete --exclude-from=sys_dont_replicate.list -e ssh > root@patron:/etc/ /etcYour exclude-from file is set up for a root-level rsync. But you are testing from top-level of /etc, which means all your exclude paths are rooted at /etc/, not at /. That's why they don't match (e.g. rsync is testing for /etc/etc/lilo.conf instead of /etc/lilo.conf). The easiest 'fix' for temporary testing is to use the root directory like you will be doing later, include /etc, and exclude other top-level dirs: rsync -avv -n --delete --include=/etc --exclude=/* --exclude-from=sys_dont_replicate.list -e ssh root@patron:/ / Then just remove the extra --include and --exclude when you are ready to test the whole hierarchy. -- John Van Essen Univ of Minn. Alumnus <vanes002@umn.edu>