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 ?

1 Answer 1

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.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.