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

Thread: using rsync to create an exact mirror

  1. #11
    Join Date
    Mar 2005
    Beans
    98

    Re: using rsync to create an exact mirror

    Quote Originally Posted by anglican View Post
    Have you tried the"--modify-window=1" switch (you can even try numbers larger than 1 - though that shouldn't be necessary)? Whilst I wouldn't expect this to be a problem with jfs (which is normally a very reliable file system) there may be some issue with times that is causing this. If you get the same problem backing up jfs->jfs then I guess it's time to submit an rsync bugreport

    H
    Yeah, it's still not working. I appreciate the replies though! I don't think it's a time thing because I'm just creating directories and files on the destination which never existed on the source, and then when I run an rsync test the subdirectories I created don't get deleted.

    Code:
    [mike@robots mike]$ pwd
    /media/8c4d270d-6139-4fed-8a32-2df8d28acdf3/mike
    [mike@robots mike]$ mkdir deleteme1
    [mike@robots mike]$ cd deleteme1/
    [mike@robots deleteme1]$ touch deleteme1.txt
    [mike@robots deleteme1]$ cd ../
    [mike@robots mike]$ cd ./Desktop/
    [mike@robots Desktop]$ mkdir deleteme2
    [mike@robots Desktop]$ cd deleteme2/
    [mike@robots deleteme2]$ touch deleteme2.txt
    [mike@robots deleteme2]$ rsync -avn --delete /home/mike/ /media/8c4d270d-6139-4fed-8a32-2df8d28acdf3/mike | grep deletem
    deleting deleteme1/deleteme1.txt
    deleting deleteme1/
    [mike@robots deleteme2]$
    So, it doesn't get rid of deleteme2. It'll only do the subdirectories in the "root" of the backup.

    Code:
    [mike@robots deleteme2]$ cd ../
    [mike@robots Desktop]$ rsync -avn --delete /home/mike/Desktop/ /media/8c4d270d-6139-4fed-8a32-2df8d28acdf3/mike/Desktop | grep deletem
    deleting deleteme2/deleteme2.txt
    deleting deleteme2/

  2. #12
    Join Date
    Oct 2009
    Beans
    Hidden!

    Re: using rsync to create an exact mirror

    This seems like a good day for a WAG about this issue.

    Does it make any difference if you use

    rsync -av --delete /home/mike /media/8c4d270d-6139-4fed-8a32-2df8d28acdf3

    instead of

    rsync -av --delete /home/mike/ /media/8c4d270d-6139-4fed-8a32-2df8d28acdf3/mike

    It's just something I would try before making the bug report, not much hope.


    Edit: You did try delete-after didn't you?
    Last edited by QLee; August 13th, 2010 at 07:24 PM. Reason: another thought

  3. #13
    Join Date
    Oct 2009
    Beans
    Hidden!

    Re: using rsync to create an exact mirror

    Quote Originally Posted by pataphysician
    Yeah, it's still not working. I appreciate the replies though! I don't think it's a time thing because I'm just creating directories and files on the destination which never existed on the source, and then when I run an rsync test the subdirectories I created don't get deleted.
    Forgive me for not reading this carefully enough the first time. When I use rsync to "mirror" a dir it is for the purposes of backup, I want an exact copy. It seems from your testing you're trying to create a way to "mirror" two directories, either of which could change (in my situation the "backup" never has files injected by myself or the system, so the occasion never arises where they would need to be deleted because they weren't on the source). Maybe you should look at the package unison, to synchronise both ways.

  4. #14
    Join Date
    Mar 2005
    Beans
    98

    Re: using rsync to create an exact mirror

    Well, like most of the stuff I ask about here, it turns out I was just being an idiot. I posted to the rsync mailing list and someone asked me to check the more verbose output (-vvv). Turns out there's a sub-directory in my home that's owned by root and which I don't have read access to. Once rsync hit that, I guess it would just give up on deleting anything else? I'm excluding that directory now and everything looks fine. Thanks again for everyone's replies.

  5. #15
    Join Date
    Oct 2009
    Beans
    Hidden!

    Re: using rsync to create an exact mirror

    Quote Originally Posted by pataphysician View Post
    Well, like most of the stuff I ask about here, it turns out I was just being an idiot. I posted to the rsync mailing list and someone asked me to check the more verbose output (-vvv). Turns out there's a sub-directory in my home that's owned by root and which I don't have read access to. Once rsync hit that, I guess it would just give up on deleting anything else? I'm excluding that directory now and everything looks fine. Thanks again for everyone's replies.
    Well that points you to another problem you'll have to solve, how did that dir get there where it doesn't belong and how can you prevent it in future.

    If you'd rsynced as root rather than as user it would have worked as you expected, wouldn't it, and the permissions would have still been preserved.

  6. #16
    Join Date
    Jun 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Lightbulb Re: using rsync to create an exact mirror

    For those who arrived at this particular thread while searching for mirrors or clones or back-ups:

    We use Clonezilla and reference it for the non Command-line Commandos amongst us.

    http://distrowatch.com/table.php?dis...ion=clonezilla

    .
    Link: Help Vampires? * * * Please Edit First Post Title With "[SOLVED]" When It Is!
    MANDATORY INFORMATION: make, model/build number, OSes, software, accessories
    /customizations/modifications/peripherals/etc...and a DETAILED account of difficulties!

  7. #17
    Join Date
    Jan 2008
    Beans
    307
    Distro
    Ubuntu

    Re: using rsync to create an exact mirror

    Glad to hear you figured it out pretty much on your own! It's amazing sometimes how little things like that will throw off such a seemingly simple process. Best of luck in your future endeavors!

Page 2 of 2 FirstFirst 12

Tags for this Thread

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
  •