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.
rsync -avl source destination
The site below provides 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.
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 breaking it down in order:-
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.
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.