rsync: exclude / include
Dear all,
Code:
rsync -avR /home/chris/ --delete --exclude="temp/" --exclude=".*" --link-dest=../last /media/alteplatte/backups/cd/$TODAY >> $LOG 2>&1 - Chris |
I don't use include and exclude but rather filter
--filter='+ .thunderbird/***' --filter='- .*' If you include anything that is covered by a blanket exclude you must put the include before the exclude. If you want everything inside a sub directory you use *** not * The example given is a simple one as the sub directory is directly off the excluded path, if you wanted instead to include some sub sub directory then you would need to do something like this :- --filter='+ .thunderbird/' --filter='+ .thunderbird/sub-directory-here/***' --filter='- .*' Just a little gotcha when things get complicated. |
Thank you very much. This is exactly what I was looking for.
|
you can also make an excludes.txt file and populate that.
in my backup script that runs on all of the laptops in the house: Code:
rsync -aviS --exclude-from=${HOMEDIR}/excludes.txt ${PWD}/ ${RUSER}@${RHOST}:${RDIR}/${dow}/ >> ${log} 2>&1 Code:
$ cat excludes.txt |
Thank you. I don't have so many subdirectories I want to backup, but exlcudes.txt is a clearly arranged list, I'll use when I add more folders.
|
All times are GMT -5. The time now is 07:17 AM. |