At Tue, 2 Oct 2007 it looks like Alfred von Campe composed:
I am trying to exclude a directory (and all file and sub-directories under that directory) when using rsync.
I have spent two days on google, but everything that I can find there involves excluding individual files, not an entire directory.
Have you tried a simple "rsync --exclude remove_dir ..."?
Alfred
I was tasked with backing up my /home/ directory but leave out stuff that I don't need like:
/home/wiliweld/.firefox
and other "dot" file directories.
So, first I'll show you the crontab entry by using the "crontab -l" command:
##################################################################
[root@liam ~]-> crontab -l
1 1 * * * /usr/bin/rsync -avz /home/wiliweld/ /data1/home-wiliweld/ --exclude-from=/root/rsync-exclude.txt
##################################################################
In my /root/rsync-exclude.txt file I have entries like this:
##################################################################
[root@liam ~]-> cat /root/rsync-exclude.txt
- .adobe/ - .beagle/ - .config/ - .fontconfig/ - .fonts/ - .gconf/ - .gconfd/ - .gimp-2.2/ - .gnome2/ - .gnome2_private/ - .gnupg/ - .java/ - .kde/ - .local/ - .macromedia/ - .mcop/ - .mozilla/ - .ooo-2.0/ - .pork/ - .qt/ - .sane/ - .skel/ - .supertux/ - .thumbnails/ - .vlc/ - .vmware/ - .wapi/ - .xemacs/ - .xine/ - .zinf/ - .DCOP*/ - .inputrc/ - .lesshst/ - .realplayerrc/
##################################################################