Re: rsync question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 13Jul2020 11:25, Patrick O'Callaghan <pocallaghan@xxxxxxxxx> wrote:
>On Mon, 2020-07-13 at 19:20 +1000, Cameron Simpson wrote:
>> Make two directories the same:
>>
>>     rsync path/to/A/ other/path/to/B/
>>
>> (no bare names after the final '/').
>
>I don't think the trailing slash matters on the destination directory.
>At least that's not what the man page seems to say (and none of the
>examples there use a trailing slash on a destination).

That is... interesting.

I expected, and I had thought years of personal rsync usage had bourne 
this out, that if there was no B directory, then

    rsync -ia A B

would make a "B" the same shape as "A".  Like "cp -a A B", when B does 
not exist.

But it doesn't, it creates B and puts an "A" inside it.

Still this makes an unwanted subdirectory (unwanted to me, most of the 
time). I still prefer the both-src-and-dst-exist approach an to use a 
trailing slash:

    rsync -ia A/ B/

which just replicates the contents of A inside B.

So I almost always want to go "make these 2 things the same", not "make 
a copy of this _inside_ that".

Cheers,
Cameron Simpson <cs@xxxxxxxxxx>
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux