• RSYNC
Rsync Tips
Rsync Tips
-
Be careful with trailing slashes with
rsync
. Always test behavior first. Excluded directories are relative to the second-to-last folder of the copy-from arg. Here I am copying thesome
folder. But in order to exclude folders directly beneathsome
, I must still referencesome
in the exclusion. Note the trailing slash at the remote location, which means thesome
folder is copied into/bk/
rather than replacing the contents of/bk
with the contents ofsome
.rsync -av --delete --delete-excluded --exclude={"some/folder-A","some/folder-B"} /home/user/some remote-sys:/bk/