You are not logged in.

#1 2016-10-30 19:43:31

Omar007
Member
Registered: 2015-04-09
Posts: 368

Rsync backup; every new base image with hard links for unchanged files

I'm planning to backup my system using rsync on a daily schedule.
Right now I'm looking at setting it up using incremental/differential backups for each day of the month, where every new month a full backup is made so old backups can be deleted on a per-month basis if space is required.

For this I've currently come to the following command:

DAY=$(date +%d)
MONTH=$(date +%m)
YEAR=$(date +%Y)

rsync --info=progress2 -aAXHPS --exclude-from=<excludelistfile> --backup-dir=rsync://<server>/<backupshare>/${YEAR}/${MONTH}/${DAY} / rsync://<server>/<backupshare>/${YEAR}/${MONTH}/base

As mentioned before I'd like every new month to have a new full backup but on the server side space could be saved while still supporting the 'per-month deletion' by using hard-links to files that did not change.
How would I go about this? Since the days of the previous month only contains rsync delta information, I'd have to use the previous month's base image as the base for the next one right?

I'm currently thinking I'd need something along the lines of a `cp -al <previousmonth>/base <currentmonth>/base`, however I'm not sure how to do this with rsync (since the folders are on a remote system accessed over rsync, not locally).

Last edited by Omar007 (2016-10-30 19:44:22)

Offline

Board footer

Powered by FluxBB