hiddenFile from any every directory it copies!īut if you have more than a few exclusions, you're better off with -exclude-from and a file.
hiddenFile /home/chris/ that since there's no slash, that one will exclude. If you only need to exclude one directory, just do this (avoiding a separate file): rsync -Paz -exclude /Downloads /home/chris/ can also chain together -exclude tags, like so: rsync -Paz -exclude /Downloads -exclude '/Something Else' -exclude. THE EASIEST WAY (to exclude only a few paths) I'm assuming you only want to exclude your 'top-level' (relative to the source directory, aka the 'root of transfer') Downloads directory, so you'll want the leading /. Note that if you don't specify the leading /, and you happen to have other directories named 'Downloads', those would also be excluded.
So try removing the /home/chris parts from your rsync-exclude.txt file.Īctually, you should just need a single line in the file: /Downloads Rsync -Paz -exclude-from 'rsync-exclude.txt' / your exclusions should work (but you'd be copying everything else on that filesystem!).īut since you're just trying to sync your home directory, and there is no subdirectory of /home/chris named 'home/chris/Downloads', rsync finds nothing that matches. The root of transfer in this case is /home/chris. With rsync, all exclude (or include!) paths beginning with / are are anchored to the ' root of transfer'. You are providing absolute paths in your exclude list.