I am trying to set up rsync to synchronize my main web server to the remote server by adding newly generated file to the latter.
Here is the command that I use:
rsync -avh --update -e "ssh -i /path/to/thishost-rsync-key" remoteuser@remotehost:/foo/bar /foo/bar
But it seems that the web server actually transfers all files despite the '–update' flag. I have tried different flag combinations (e.g. omitting '-a' and using'-uv' instead) but none helped. How can I modify the rsync command to send out only newly added files?
Best Answer
From
man rsync
:--update
does something slightly different, which is probably why you are getting unexpected results (seeman rsync
):