Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Maintain Parity Between Folders?

  1. #11
    Join Date
    Dec 2008
    Location
    Indiana, United States
    Beans
    764

    Re: Maintain Parody Between Folders?

    Quote Originally Posted by The Cog View Post
    rsync -r --delete /path/to/A /path/to/B
    will duplicate folder A into folder B so now you have a copy of folder A in folder B.

    If you want to just duplicate the contents of folder A into folder B, put a slash after the A like this:
    rsync -r --delete /path/to/A/ /path/to/B


    Adding a -v option may help understand what it's doing.
    This did the trick for me. Can't believe I got so frustrated with this that I had a headache for nearly 12 hours when all i was missing was a slash. I love that linux can do that in a single command but still. Can this command be used for say 3 different directories? Say I connect my mp3 player and the 2 external harddrives in my drawer? Edit again grsync does the same thing but i still have to add the / manually it appears
    Last edited by mamamia88; September 13th, 2013 at 04:39 PM.
    Whoever came up with the phrase "There is no such thing as a stupid question" obviously never had the internet.

  2. #12
    Join Date
    Jul 2005
    Location
    England
    Beans
    Hidden!

    Re: Maintain Parity Between Folders?

    Interesting!

    I could have sworn that grsync added the trailing / all by itself, but having just tried it I see you are right. I wonder if it has changed its behaviour over the many years I've been using it?
    DISTRO: Xubuntu 14.04-64bit --- Code-tags --- Boot-Repair --- Grub2 wiki & Grub2 Basics --- RootSudo

  3. #13
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    5,793
    Distro
    Xubuntu 15.04 Vivid Vervet

    Re: Maintain Parody Between Folders?

    Quote Originally Posted by mamamia88 View Post
    This did the trick for me. Can't believe I got so frustrated with this that I had a headache for nearly 12 hours when all i was missing was a slash.
    Yes, it's not obvious. It is there in "man rsync" in the USAGE section, but even so it's not obvious on a first reading. It took me a while to figure it out, too. I have used these in the past:
    rsync -r A/. B (I think that's the same as just using A/)
    rsync -r A/* B (Not so good. Expands the contents into a list before calling rsync, and misses hidden files.)
    I love that linux can do that in a single command but still. Can this command be used for say 3 different directories? Say I connect my mp3 player and the 2 external harddrives in my drawer?
    It can copy multiple files or folders to one destination. It can not copy to multiple destinations in one command. So for instance,
    rsync -r A B C D E
    would copy A, B, C and D to E. If you want to replicate to multiple destinations, put multiple rsync commands into a script and call the script.

  4. #14
    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Beans
    13,509
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Maintain Parity Between Folders?

    Use the remmina package.
    Regards, David.
    Please use the Forum search and Wiki search for immediate help
    Please mark your thread as Solved when appropriate
    New to technical forums?: How To Ask Questions The Smart Way

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •