Date: Sun, 19 Mar 2006 17:44:18 -0500 From: Parv <parv@pair.com> To: Pat Maddox <pergesu@gmail.com> Cc: FreeBSD Questions <freebsd-questions@freebsd.org> Subject: Re: rsync script not excluding dirs Message-ID: <20060319224418.GC4787@holestein.holy.cow> In-Reply-To: <810a540e0603191355n3e86fe15pa15a24da1a48dce8@mail.gmail.com> References: <810a540e0603191355n3e86fe15pa15a24da1a48dce8@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
in message <810a540e0603191355n3e86fe15pa15a24da1a48dce8@mail.gmail.com>, wrote Pat Maddox thusly... > > I have a backup script that runs nightly, and I want it to exclude > certain dirs (ports, obj, etc). However when I run the script it > doesn't exclude anything, leaving me with pretty massive backups. ... > /, /var, /usr, and /backup are all on different partitions. The key > part is at the bottom where it calls rsync and excludes dirs. Can > someone tell me what's wrong with the script? ... > PRE="/usr/local/bin/rsync" > ${PRE} -bapoguLxSRC --exclude=*.core --exclude=*~* / --exclude=/dev > --exclude=/backup /backup/${DAY1}/ > ${PRE} -bapoguLxSRC --exclude=*.core --exclude=*~* /var /backup/${DAY1}/ > ${PRE} -bapoguLxSRC --exclude=*.core --exclude=*~* --exclude=/usr/src > --exclude=/usr/ports --exclude=/usr/obj /usr /backup/${DAY1}/ Your script seems to have wrapped by your mail client. Anyway, in rsync(1) man page, see "INCLUDE/EXCLUDE PATTERN RULES" section, point 2 ... o if the pattern ends with a / then it will only match a direc- tory, not a file, link, or device. In other words, none of your exclude patterns for directories end in '/' , thus the backup, src, ports, etc. directories are not excluded. - Parv --
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060319224418.GC4787>