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 ...
- 05-15-2009 #1Just 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.
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:rsync -avl source destination
Code provided:-
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:-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/
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
- 05-18-2009 #2Linux Guru
- 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!
- 05-18-2009 #3Just 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...


Reply With Quote