Recipe 16.8. Fine-Tuning File Selection

 < Day Day Up > 

16.8.1 Problem

You would like to exclude some files (such as .tmp and .bak files) from being backed up, or you would like to create a list of included files.

16.8.2 Solution

Put your file lists in files, then call them with rsync's --exclude-from or include-from options.

The files can contain a list of files, regular expressions, or both:

*.tmp *.temp *.bak /etc/skel /etc/local

Then add the --exclude-from or include-from option on the rsync command line:

$ rsync -ae ssh /home /etc --exclude-from=~/exclude-list backup.test.net:/home-etc

16.8.3 Discussion

It's best to use only one or the other; using both options is the fast track to confusion.

16.8.4 See Also

  • rsync(1)

     < Day Day Up > 


    Linux Cookbook
    Linux Cookbook
    ISBN: 0596006403
    EAN: 2147483647
    Year: 2004
    Pages: 434

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net