On Tue, Dec 3, 2013 at 6:55 AM, Andre Majorel <aym-2cn...@teaser.fr> wrote:

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

To do that with rsync you need to specify the destination directory,
leaving off the destination filename part. e.g. if you want to create
/dest/foobar from /src/foobar, you would copy:

rsync -aiv /src/foobar /dest/

See also --force if you want a /dest/foobar dir to be removed even if it is
not empty.

If you're wanting to change the name of a file for the transfer, the only
way to do that with this idiom is to create the new name on the source side
for the transfer, e.g.:

ln -s /src/foobar barbaz
rsync -aiv -L barbaz /dest/
rm barbaz

..wayne..
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to