hmmm... that kinda makes sense, but not completely...

If the excludes file contains file patterns to match, then omitting the /home 
part of the path leaves a directory path (or pattern) that can be matched.  
However,  one would think the full path (with the /home) would also 
constitute a pattern to match.  Unless like you say, the excludes are 
relative to the directory the script is running from?

If this is the case, then speculation suggests that if we were to cd / from 
within our script, before the rsync command, the full path will work....  
I'll try this out later tonight and see how it goes...

Thanks for the effort Mike.

Shawn

On Tuesday 12 April 2005 22:16, Mike Fitton wrote:
> No time like the present to get stuck in to this :) I played with your
> script and I think I've found the answer...hopefully it works ;) Please
> correct me if I'm wrong!
>
> I used your script as is (modified for my directory paths) and then tried
> your excludes.txt (again modified) It did the same thing as yours did.
>
> I made a new backup directory under my user account with the two files:
>
> ~mike/backup/script.sh
> ~mike/backup/example.txt
>
> I then removed the "/home" from the begining of the example.txt ie;
>
> #--------------------------------------------------------------------------
>------ *.iso
> - /mike/temp/*
> - /mike/downloads/*
> - /mike/Mail/*
> - /mike/Mail.old/*
> #-----------------------------------------------------
>
> I also added the "n" to the "-va" for a dry-run, verbose backup, and it
> seems to work as far as I can tell. I wondered if the excludes.txt just
> needs to reflect its relativity to the script and not the complete path of
> the file....??
>
> #--------------------------------------------------------------------------
>------ SOURCE="/home/mike"
> EXCLUDE="/home/mike/backup/exclude.txt"
> DESTINATION="/home/mike/backup"
>
> #Destination Server
> #DESTSRV="[EMAIL PROTECTED]"
> #DESTSRV=""
>
> rsync -van --exclude-from=$EXCLUDE $SOURCE $DESTINATION
> #--------------------------------------------------------------------------
>------
>
> Hope this helps :)
> Mike
>
> On Tuesday 12 April 2005 6:23 pm, Shawn wrote:
> > Thanks Mike.
> >
> > I was able to find other sites similar to that one - though I do like the
> > layout of that script better... :)  It doesn't really explain the
> > excludes file too well though, but it's a decent start..
> >
> > So, if I added "*.iso" to the exclude file, then all iso files would be
> > excluded.  So far so good.  But what if I want to exclude an entire
> > directory?  Can I just do "/some/directory/*" ?  This wasn't working for
> > me last night...

_______________________________________________
clug-talk mailing list
[email protected]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca
Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
**Please remove these lines when replying

Reply via email to