Autorestic/runcron
2021-11-24 10:13:07 +01:00

14 lines
530 B
Bash
Executable File

#! /usr/bin/env bash
autorestic -c /etc/autorestic/.autorestic.yml --ci cron --lean 1> /tmp/autorestic.log 2>/tmp/autorestic-err.log
ret=$?
if [ "$ret" != 0 ] || [ -s /tmp/autorestic-err.log ]
then
printf "Command failed with return code $ret and log:\n$(cat /tmp/autorestic-err.log)" | mail -s "Autorestic Backup: Failed" root
else
if [ -s /tmp/autorestic.log ]
then
printf "Command successfully finished with the following log:\n$(cat /tmp/autorestic.log)" | mail -s "Autorestic Backup: Success" root
fi
fi