LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   rsync question (https://www.linuxquestions.org/questions/linux-general-1/rsync-question-503000/)

hepburnenthorpe 11-19-2006 11:12 AM

rsync question
 
Ok.. Im trying to write my own backup script using rsync, and im having a little difficulty understanding how to backup multiple directories without using a loop.

For instance, I would like to backup /etc and /home/thorpe, however I would like to skip /home/thorpe.mozilla and /home/thorpe.thumbnails.

Ive tried....
Code:

rsync -va --delete --delete-excluded --include="/etc /home/thorpe" --exclude="/home/thorpe.mozilla /home/thorpe.thumbnails"
but its just not working. Anyone give me a push? Im reading the manual entry but just not getting it.

Also, would there be a way to backup /home but skip say /home/user/tmp for each user? Something like /home/*/tmp ?

Thanks.

PS: Im not interested in using files as it seems --include-from and --exclude-from do.

trickykid 11-19-2006 05:19 PM

Most of rsync options don't need the = after the option.

Code:

rsync --delete --delete-excluded --exclude thorpe.mozilla --exclude  thorpe.thumbnails --exclude tmp -a /home/thorpe /etc user@host:/destination/directory
#disregard the user@host: if you want to backup locally somewhere.


All times are GMT -5. The time now is 06:27 PM.