2

I am using rsnapshot for daily/weekly backups which are triggered by anacron, that works nice.

However instead of checking the logs by hand, I would like to receive a mail whenever a backup failed. This mail should consist of the full rsnapshot output.

I did not find this feature in the rsnapshot.conf or man-page, so I quess I have to script it myself ?

Alex
  • 163
  • 1
  • 7

1 Answers1

2

Ok, here is what I did for now: First I installed "postfix" as mail-server. Than I added some lines to my shell-script:

...
OUTPUT=`rsnapshot $ARGUMENT`
if [ $? -ne 0 ]
then
   echo "${OUTPUT}" | mail -s "rsnapshot report" myname@gmail.com
fi

Edit: Actually it is much more useful to just forward all local mails to my private mail-account. This can be done by changing just one line in /etc/aliases:

#root: mylocalaccount <-- comment out old line and add:
root: myname@gmail.com

Like that, the output of all cron/anacron-jobs which are marked with "--report" are automatically sent to me.

Alex
  • 163
  • 1
  • 7