Hi all, I'm trying to backup a disk using rsync but I need to exclude some folder. I'm using rsync 3.0.4 under cygwin on a winxp machine. The script that I use is: # ---------------------------------------------------------------- # SRCDIR=/cygdrive/d LOGDIR=/cygdrive/f BCKDIR=/cygdrive/f/Backup rsync -auv --progress --delete --delete-excluded --log-file=$LOGDIR/`date +%Y%m%d`.log --exclude from='/cygdrive/f/.bak_exclude' $SRCDIR/ $BCKDIR # ---------------------------------------------------------------- # and my file where there is the list of excluded folders looks like: # ---------------------------------------------------------------- # - /cygdrive/d/Software/ - /cygdrive/d/Intel/ - /cygdrive/d/Sysprep2003/ - /cygdrive/d/RECYCLER/ # ---------------------------------------------------------------- # The problem is that rsync is not skipping these folders. If I increase the verbosity level this is the output # ---------------------------------------------------------------- # [client] parse_filter_file(/cygdrive/f/.bak_exclude,0,3) [client] add_rule(-s /cygdrive/d/Software/) [client] add_rule(-s /cygdrive/d/Intel/) [client] add_rule(-s /cygdrive/d/Sysprep2003/) [client] add_rule(-s /cygdrive/d/RECYCLER/) sending incremental file list [sender] make_file(.,*,0) [sender] make_file(Documents,*,2) [sender] make_file(Downloads,*,2) [sender] make_file(Intel,*,2) [sender] make_file(Matlab_Fuctions,*,2) [sender] make_file(Personal,*,2) [sender] make_file(RECYCLER,*,2) [sender] make_file(Scripts,*,2) [sender] make_file(Software,*,2) [sender] make_file(Sysprep2003,*,2) [sender] make_file(System Volume Information,*,2) # ---------------------------------------------------------------- # Am I doing something wrong? Thanks for any help. Cheers Ale -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20090818/a813f40e/attachment.html>
On Tue 18 Aug 2009, Alessandro Toso wrote:> > rsync -auv --progress --delete --delete-excluded --log-file=$LOGDIR/`date > +%Y%m%d`.log --exclude from='/cygdrive/f/.bak_exclude' $SRCDIR/ $BCKDIRIf this is your exact command, then you're excluding the file "from='/cygdrive/f/.bak_exclude'" You probably meant --exclude-from='/cygdrive/f/.bak_exclude' (note the dash between --exclude and from).> # ---------------------------------------------------------------- # > > and my file where there is the list of excluded folders looks like: > > # ---------------------------------------------------------------- # > - /cygdrive/d/Software/ > - /cygdrive/d/Intel/As you're specifying this file for --exclude-from, the '-' at the beginning is not needed. Paul
On Tue, 2009-08-18 at 16:58 +0200, Alessandro Toso wrote:> I'm trying to backup a disk using rsync but I need to exclude some folder. I'm using rsync 3.0.4 under cygwin on a winxp machine. > The script that I use is: > > # ---------------------------------------------------------------- # > SRCDIR=/cygdrive/d > LOGDIR=/cygdrive/f > BCKDIR=/cygdrive/f/Backup > > rsync -auv --progress --delete --delete-excluded --log-file=$LOGDIR/`date +%Y%m%d`.log --exclude from='/cygdrive/f/.bak_exclude' $SRCDIR/ $BCKDIR > # ---------------------------------------------------------------- # > > and my file where there is the list of excluded folders looks like: > > # ---------------------------------------------------------------- # > - /cygdrive/d/Software/ > - /cygdrive/d/Intel/ > - /cygdrive/d/Sysprep2003/ > - /cygdrive/d/RECYCLER/ > # ---------------------------------------------------------------- # > > The problem is that rsync is not skipping these folders.Exclude patterns with a leading slash are interpreted from the root of the transfer, in this case /cygdrive/d/ . So you should not include that prefix in your patterns. See "ANCHORING INCLUDE/EXCLUDE PATTERNS" in the rsync man page for more details. -- Matt
Seemingly Similar Threads
- [ycui1@bloomberg.com: Re: rsync bug?? (rsync fails when -C is used).]
- Bug#306368: filter rules are too modern for remote rsync (which is 2.5.6)
- Strange bug (buffer overflow) happening only under cron
- Error 11: can not backup /var/lib/zope2.9
- unprotecting the first 64KB of memory to allow real-mode calls.