A simple shell script, called incremental RSYNC, to handle full and incremental backups using the open-source utility RSYNC.
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.
Command-line options,
irsync TARGET_DIR DESTINATION_DIR [MAXDAYS]
Details,
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.
The irsync log of changes.
Fixed minor bugs only.
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.
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.