by furyg3 · 17y ago · 0 comments
Steps: First run:
* Rsync data from source drive to backup drive (can be done over network, ssh, whatever). We'll call this backup "0"
Second run:
* On the backup drive, copy the last backup folder (backup "0") to a new backup folder (backup "1"), using hardlinks. Hardlink copies don't take any additional space, since they're pointing to the original resource on the disk (folders do add some negligible space).
* Rsync data from source drive to backup drive (backup "1"). Rsync, of course, only updates what's new/changed.
Repeat, saving as far back as you'd like, and deleting old backups if the drive is full, after N backups, or so many days. Now you've got an easy incremental backup bash script.
Hardlinks are beautiful, because they don't add extra space, and once all the hardlinks to a resource are deleted the resource becomes free space. This isn't an enterprise-level backup solution, but it's a great quick-and-dirty way to do incremental backups, and is exactly how Time Machine works.
But, yeah, same basic concept for sure.