rsync backup over network?
by dchmelik from LinuxQuestions.org on (#5EB0W)
I'm trying to do a complicated rsync backup of a home directory on a local area network (LAN.) I need to exclude some directories but in some cases that doesn't work. Unfortunately some also have spaces (which I learned can still be backed up by escaping the slash twice.) I saw examples on various question & answer sites of how to exclude them but there was a lot of speculation and sloppy writing, so nothing there worked. I'm able to exclude directories one level in like /home/user/directory1 (can exclude directory1) but not multiple levels in like /home/user/directory1/directory2 (however I try to exclude directory2, even if it doesn't have spaces, it always gets copied.) What's the exact way to do that, or is there an easier way to list exclusions in an exclude_file.txt, --exclude-from=exclude_file.txt and what would be the format of such a file (also in the case of directories with spaces?)
My recent command was something like the following (in which /home/user/directory1/directory2/directory3 always was copied) (I did this in several steps.)
Code:rsync -av --info=progress2 --delete --exclude=directory2/directory3 sourcehost:/home/user/directory1/ /home/user/directory1


My recent command was something like the following (in which /home/user/directory1/directory2/directory3 always was copied) (I did this in several steps.)
Code:rsync -av --info=progress2 --delete --exclude=directory2/directory3 sourcehost:/home/user/directory1/ /home/user/directory1