Questions about rsync

Walter Dnes waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org
Fri Apr 28 04:23:25 UTC 2006


On Thu, Apr 27, 2006 at 03:45:46PM -0400, Alex Beamish wrote

> My condolences .. I have run into the same challenge using the 'exclude'
> argument with rsync. The logic behind it at the time was impenetrable -- all
> I know is I got it to do what I wanted, albeit with a ridiculously long
> command line.

  That's what include and exclude files are for.  Here's "~/bin/sync1"

#!/bin/bash
if [ -a /home/waltdnes/minmax.zip ]; then
  rm /home/waltdnes/minmax.zip
fi
zip -9r /home/waltdnes/minmax.zip /home/waltdnes/spoolastra/* -i */.minmax
rsync -av --delete --exclude-from=/home/waltdnes/.excludersync1 \
  /home/waltdnes/ /mnt/bigdrive/waltdnes/

...and here's "~/.excludersync1"

spoolastra/slrnpull/news/
.mozilla/firefox/aaaaaaaa.default/Cache/
.mozilla/firefox/bbbbbbbb.trading/Cache/

  According to what I've googled, you can get away with just one file.
If you prefix lines will a "+" that expanded file pattern will be
included, and lines prefixed with "-" will exclude files *REGARDLESS* of
whether the list is invoked as "--exclude-from" or "include-from"!!!  It
is parsed in order, so you can do some cute stuff about what is included
or excluded, i.e. you can have exceptions to exceptions, etc.

-- 
Walter Dnes <waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org> In linux /sbin/init is Job #1
My musings on technology and security at http://tech_sec.blog.ca
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list