Guard against destination = existing directory

Andre Majorel aym-2cnysr at teaser.fr
Tue Dec 3 07:55:17 MST 2013


Trying to use rsync to make sure that _dest_ is a regular file
with the same content as file _source_.

If _dest_ already exists and is a symlink, FIFO or device file,
rsync deletes it and creates a regular file in its place. Good.

If _dest_ already exists and is a directory, rsync creates
_dest_/$(basename _source_). Not what I want.

Is there an option similar to GNU install -T or GNU cp -T which
guarantees that if _dest_ exists and is a directory, rsync will
either remove it or fail, but NOT use it as a path ?

Thanks in advance.

-- 
André Majorel http://www.teaser.fr/~amajorel/


More information about the rsync mailing list