[[ coldCLOUD ]]

2011.10 Incremental RSYNC

A simple shell script, called incremental RSYNC, to handle full and incremental backups using the open-source utility RSYNC.

Description

First time run it makes a full backup. On every successive run it makes an incremental backup using RSYNC with the –link-dest option - i.e. it hard-links unchanged files from the last full backup directory and hence saves space. When run more than a user-defined number of days after the last full backup it makes another full backup.

Note: it does not delete any backup directories, it just continues to create new ones.

Usage

Command-line options,

irsync TARGET_DIR DESTINATION_DIR [MAXDAYS]

Details,

  • TARGET_DIR is the directory that is to be backed up
  • DESTINATION_DIR is the directory in which the backups are to be placed
  • MAXDAYS is the maximum number of days before doing a FULL backup again (optional, default 30).

If you need to use RSYNC's exclude patterns with irsync, then just place a file called irsync.exclude in the DESTINATION_DIR. When irsync notice the irsync.exclude file it will pass it to RSYNC using the –exclude-from option.

Download

Change log

The irsync log of changes.

Version 1.02 (2012.09)

Fixed minor bugs only.

Version 1.01 (2012.04)

Here the backup directories are named using ISO-8601-style dates - i.e. yyyymmddThhmmss_full or yyyymmddThhmmss_inc. Using this name style irsync can perform one backup every second.

A new feature was added in this version: placing a file called irsync.exclude in DESTINATION_DIR makes irsync use the RSYNC –exclude-from option togheter with the irsync.exclude file.

Command calls are now all handled by script parameters initialized hard-coded in the header of the script. Leave them as is or change them to absolute paths to match your system.

Version 1.00 (2011.10)

Initial version.

Here the backup directories are named YYYYMMDD_full or YYYYMMDD_inc. With these directory names it will only do one backup per day.