Find the answer to your Linux question:
Results 1 to 3 of 3
Watcha, Am new to Linux and although I've dabbled with some of the gui's (DSL & Zubuntu) I have now immersed myself in the Linus CLI due to hacking a ...
  1. #1
    Just Joined!
    Join Date
    May 2009
    Posts
    5

    Basic Rsync / other linux command help

    Watcha, Am new to Linux and although I've dabbled with some of the gui's (DSL & Zubuntu) I have now immersed myself in the Linus CLI due to hacking a mybook world edition. I've switched on SSH on one of the little NAS boxes and have installed a fair bit of new software, and I now want to set up a decent backup routine on it before it becomes my families storage box.

    I'm backing ip the MBWE with an identical sized usb HD.

    I'm still working my way through all these new Linux commands, half because I want to learn a little more and half because I want to setup a nice simple script for incremental backups.

    I used the code below and it worked well but would like to push it to the next level.

    Code:
    rsync -avl source destination
    Mike Rubels page on R-sync backups provided a script which looks to be what I'm after, but I can't quite get my head around it and am wondering if it will just provide the same snapshot of the same chunk of data under certain circumstances.

    Code provided:-

    Code:
    rm -rf backup.3
    mv backup.2 backup.3
    mv backup.1 backup.2
    cp -al backup.0 backup.1
    rsync -a --delete source_directory/  backup.0/
    Obviously it builds up from the bottom as you implement it, so if I break it down as I understand it, in the order it would be done in:-

    Day 1 - Rsync's all data into a folder called backup.0
    Day 2 -Copies hardlinks of backup.0 into backup.1 - Effectively not a copy as such, only copies a link to the original file. Then Rsync copies any files added, or updated and deletes any files removed.

    It's this stage that confuses me if I copy a hard link of file A, but the original A has updated and so copied over by rsync, isn't the copy in backup.1 still pointing to the updated file in backup.0 and therefor not really a backup from the previous day?

    I guess I'm just not sure how the copy and rsync and hardlinks interact. Any observations / pointers / explanations would be appreciated.

    Thanks

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Hard links look to applications like the same file, though it's possible that rsync might detect the link and first unlink the file in backup.0/ before copying the updated file there. I don't know enough about rsync to say for sure. Have you read the man pages and info documentation?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    May 2009
    Posts
    5
    Thanks rubberman,

    I had a look, and I can't see anything like the info I'm after, that saying it could still be there, as I said I'm a bit green on Linux command line...

    I've kind of got to the point when the only sensible thing to do is to try it out...

Posting Permissions

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