[plug] Rsync script

Andrew Furey andrew.furey at gmail.com
Wed Mar 25 17:15:00 WST 2009


On 25/03/2009, Nigel Duff <nigel at dubh.id.au> wrote:
> I have the following bash script to rsync my home dir to another
>  drive. It copies the files ok, but ignores the "--exclude-from="
>  directive.
>
>  What obvious thing am I missing?
>
>  -----------------------------------------------------
>  #!/bin/bash
>
>  SOURCE="/home/nigel/"
>  DEST="/Storage1/Backups/liath/"
>
>  RULES="/home/nigel/.rsync_rules"
>
>  B1_Opts="-azmhxsvv --delete --delete-during --timeout=180"
>
>  rsync $B1_Opts --exclude-from=$RULES $SOURCE $DEST
>
>  -----------------------------------------------------
>
>  And my .rsync_rules file looks like this;
>
>  -----------------------------------------------------
>
>  -/home/nigel/e17_src
>  -/home/nigel/Incoming
>  -/home/nigel/.cache
>  -/home/nigel/.mozilla/firefox/9x8e7slg.default/Cache
>  -/home/nigel/.opera/cache4
>  -/home/nigel/.opera/opcache/
>  -RCS SCCS CVS CVS.adm RCSLOG cvslog.* tags TAGS .make.state
>  .nse_depinfo *~ #* .#* ,* _$* *$ *.rej .del-* *.a *.olb *.o *.obj
>  core .svn/ .git/ .bzr/

I've used exclude though not exclude-from, but I wondered - does it
need relative paths? So the file looking like

e17_src
Incoming
.cache
.mozilla/firefox/9x8e7slg.default/Cache

etc.

HTH
Andrew

-- 
Linux supports the notion of a command line or a shell for the same
reason that only children read books with only pictures in them.
Language, be it English or something else, is the only tool flexible
enough to accomplish a sufficiently broad range of tasks.
                          -- Bill Garrett



More information about the plug mailing list