SRC=/, include a few directories and exclude everything else

H.S. hs.samix at
Tue Dec 6 18:36:27 GMT 2005


I am currently backing up a few Linux boxes, and a Windows XP box, using
rsync (through a cron job).

Regarding the Windows box ( Windows XP (running Cygwin) <--> Debian
Testing), so far I specify a few directories as sources in the rsync
command line. I then use an excludes file to include certain directories
and exclude others.

I was wondering, can I just specify / as the source and specify the dirs
that I want to include and leave everything out? (This would simplify my
command line of rsync.)

I have tried this as the excludes file (with source / in rsync command
+ */
+ Documents and Setting/WinUser/My Documents
+ Documents and Setting/WinUser/Start Menu/
+ Documents and Setting/WinUser/Recent/
+ Documents and Setting/WinUser/Application Data/Mozilla/
+ Documents and Setting/WinUser/Application Data/Thunderbird/

- *

The idea is to backup only the directories mentioned above, and leave
everything else out. But given these rules, nothing is backed up.

I know this is a newbee questions, but I am trying this example based on
the man page of rsync and seem to hitting this wall.

All help is appreciated,

More information about the rsync mailing list