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?
rsync /foo/bar remoteuser@remotehost:/foo/bar
-a
option implies (owner, group, perms, ...) it should be the cause of our issue.-c
option. It skips existing files based on a checksum, instead of modification time or size.