<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Dec 3, 2013 at 6:55 AM, Andre Majorel <span dir="ltr"><<a href="mailto:aym-2cnysr@teaser.fr" target="_blank">aym-2cnysr@teaser.fr</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":2d2" style="overflow:hidden">If _dest_ already exists and is a directory, rsync creates _dest_/$(basename _source_). Not what I want.</div>

</blockquote></div><br>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:</div><div class="gmail_extra">

<br></div><div class="gmail_extra"><font face="courier new, monospace">rsync -aiv /src/foobar /dest/</font></div><div class="gmail_extra"><br></div><div class="gmail_extra">See also --force if you want a /dest/foobar dir to be removed even if it is not empty.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">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.:</div>

<div class="gmail_extra"><br></div><div class="gmail_extra"><font face="courier new, monospace">ln -s /src/foobar barbaz</font></div><div class="gmail_extra"><font face="courier new, monospace">rsync -aiv -L barbaz /dest/</font></div>

<div class="gmail_extra"><font face="courier new, monospace">rm barbaz<br></font><br clear="all"><div>..wayne..</div>
</div></div>