No description
Find a file
Laurent Cozic c854cd17c6 Restoring $(basename -- "$DEST")
In case the destination is later on generated in a different way,
also makes the code and intention more explicit.
2013-11-27 12:36:54 +08:00
README.md Update README.md 2013-11-26 03:40:23 +08:00
rsync_tmbackup.sh Restoring $(basename -- "$DEST") 2013-11-27 12:36:54 +08:00

Rsync time backup

Time Machine style backup with rsync. Should work on Linux (tested on some distros), Mac OS X (fully tested) and Windows with Cygwin (not tested yet but feeback would be welcome).

Installation

git clone https://github.com/laurent22/rsync-time-backup

Usage

rsync_tmbackup.sh <source> <destination> [excluded-pattern-path]

Examples

  • Backup the home folder to backup_drive

      rsync_tmbackup.sh /home /mnt/backup_drive  
    
  • Backup with exclusion list:

      rsync_tmbackup.sh /home /mnt/backup_drive excluded_patterns.txt
    

Exclude file

An optional exclude file can be provided as a third parameter. It should be compabible with the --exclude-from parameter of rsync. See [this tutorial] (https://sites.google.com/site/rsync2u/home/rsync-tutorial/the-exclude-from-option) for more information.

Features

  • Each backup is on its own folder named after the current timestamp. Files can be copied and restored directly, without any intermediate tool.

  • Files that haven't changed from one backup to the next are hard-linked to the previous backup so take very little extra space.

  • Safety check - the backup will only happen if the destination has explicitely been marked as a backup destination.

  • Resume feature - if a backup has failed or was interrupted, the tool will resume from there on the next backup.

  • Exclude file - support for pattern-based exclusion via the --exclude-from rsync parameter.

  • Automatically purge old backups - within 24 hours, all backups are kept. Within one month, the most recent backup for each day is kept. For all previous backups, the most recent of each month is kept.

  • "latest" symlink that points to the latest successful backup.

  • The application is just one bash script that can be easily edited.

TODO

  • Minor changes (see TODO comments in the source).

  • Backup to remote drive?

LICENSE

MIT

Bitdeli Badge