Backup notifier

Warning

This page is deprecated (as of august 2009), the project as evolved quite a bit and has a new page: there.

Old presentation

You’ll find on this page, a few scripts that I have to make the backup routine a little bit easier. They all are under the Public Domain.

While these scripts dont pretend to match TimeVault on Ubuntu1, they make it possible to have a monthly notification about the need of a backup for all your precious data and an automatic procedure that will handle the backup for you (restoring data is left as an exercise ;) 2 ).

The files

Download: backup_monitoring.tar.gz

The archive content is the following:

backup_notify.py, rsync-incr-procedure.sh, rsync-incr-Documents.sh

The implemented routine

  1. The rsync-* bash files make it possible to backup subdirectories of a given folders (in the provided scripts that would be some subdirectories of $HOME/Documents but this can be easily changed by modifying the rsync-incr-Documents.sh file). The backup is incremental and so that you always get on your backup device a folder mimic each of your local folders:
    • if a file of folder is added locall, then it is directly added to the backup folder
    • if a file is suppressed then it is suppressed from the backup folder BUT another folder is create containing the date of execution of the script and that will contain the latest copy of the disappeared file. Such deprecated files are kept during three months3
  2. A nifty Python scripts checks, daily, for how long there has not been any backup made. If the latest backup is at least one month hold, then you get notified that another one is needed. A status icon shows up in your notification area, clicking on it will start the backup proces, and ou get notified at each important steps of the process (and of course in the event of any error)

Installation

  1. Copy all files in your ‘$HOME/bin’ directory
  2. Connect your backup device (harddrive ?) and create a symbolic link to it in the following way:
     ln -s /media/MyHarddrive ~/backup_destination
  3. Add the backup_notify.py script to your session’s startup sequence (Preferences->Session)

Please note that the « desktop part » of the routine is heavily based on pygtk, dbus and galago, that must be available on your system, of course.

Aknowledgment

The scripts provided on this site really helped me in setting up my own rsync scripts.

The Notification class presented on this blog post also made it possible for me to quicly understand how to use the notification framewok, thanks !

  1. TimeVault being Ubuntu’s answer to Apple’s TimeMachine, let’s be fair []
  2. it can quite esily be done by hand anyway []
  3. more precisely through 3 iterations of the backup routine []