Rsnapshot, a time-machine like tool for GNU/Linux

Rsnapshot is a file-system snapshot utility for making backups of local and remote systems. It was written in Perl language and it takes advantage of Rsync, hard link, and SSH tools to create and schedule incremental backups of file-systems or pieces of them. Its backups only taking up the space of one single full backup plus differences and keep those backups on local drive to different hard drive, an external USB stick, an NFS mounted drive or simply over the network to another machine. Rsnapshot supports hourly, daily, weekly and monthly backups that are managed using tools like Cron.

One of the several tutorials that can be found on Internet that explains how to install and configure Rsnapshot on a GNU/Linux based machine is here.

Rsnapshot produces a log file where it is possible to monitor its successful and unsuccessful activities. Unfortunately, it doesn't provide a mechanism that is able to alert automatically in other ways (i.e. sending a mail or leaving a message on the desktop) when an error occurs during the backup process (i.e. backup disk is full). Being not able to notice errors in the backup process mean to lose data and make backups unusable.

For this reason, it is useful to use a tool that is able to automatically analyze periodically the Rsnapshot log to verify the occurrence of potential errors. To this end, there is a software called Logwatch.

Logwatch is a customizable pluggable log-monitoring and analyzer system written in Perl script that provides a report on any “interesting” activity that occur in the system. It searches through system logs providing reports for the needed information with the needed details. Logwatch is easy to use and will work right out of the package on most systems.

Logwatch, by default, runs daily on yesterday’s logs, sends an email to the local root account with a low level of detail providing information about disk usage, ssh failed accesses, authentication failures and so on. Logwatch, by default, provides enough information in a daily summary to satisfy needs and curiosity about what’s going on the system especially regarding security aspects.

To monitor Rsnapshot log, there is an interesting tutorial here.

To receive the results of the Logwatch analysis in an email address that is not in the local root account, it is possible to configure Exim4 to use an external SMTP server instead of the internal mail system. A useful tutorial to configure Exim4 with Gmail is here.