How to rsync a directory to a new directory with different name?
If you want to use rsync
to recursively make the dest
directory an exact copy of the src
directory:
rsync -a src/ dest
The rsync
man page explains how this works:
A trailing slash on the source [...] avoid[s] creating an additional directory level at the destination. You can think of a trailing
/
on a source as meaning "copy the contents of this directory" as opposed to "copy the directory by name" [...]