Files
Suppose that /foo/src
contains only A.c
and that /foo/dest
contains both A.c
and B.c
. And suppose I run the following command:
rsync /foo/src/ /foo/dest
Will rsync
erase B.c
?
Folders
Now suppose that /foo/src
contains the directory A
with some files inside it and that /foo/dest
contains both directories A
and B
, each with some files inside of them. And suppose I run the following command (the -a option includes -r, recursive):
rsync -a /foo/src/ /foo/dest
Will rsync
erase B
and its contents?
Best Answer
By default, rsync does not delete files but that depends on the commands options you specify. You can use any the following if you WANT to delete files:
Since you specifically called out the -a option, here's what the man page says
So it seems the answer to your question is NO, it won't be deleted given your examples.
HTH