Linux – rsync : transferring files in one direction only

linuxrsyncsynchronization

Is it possible to use rsync to copy files in one direction only?

For example, suppose we have:

left/a.txt

right/a.txt

where the files are initially identical.

If one then modifies right/a.txt, then:

rsync -avv left/ right/

will copy right/a.txt onto left/a.txt.

Is it possible to restrict rsync to only copying from left/ to right/ (i.e. prevent it from copying from right/ to left/)?

Best Answer

You misunderstand rsync. This command:

rsync -avv left/ right/ 

will not sync anything in right to left. It will, as @atbg says, only sync left to right. Rsync is not a bi-directional syncer. It syncs the dest with the source.

Man page for reference: http://linux.die.net/man/1/rsync