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" [email protected]
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: [email protected]

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

1
  • Which file did you add this to? Jun 21, 2022 at 15:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .