Fixed cron job sending useless mails

This commit is contained in:
Antoine Lima 2021-12-28 23:43:02 +00:00
parent 5b746d9893
commit 9c0586263f
2 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,5 @@
# Backup
Configuration (autorestic, cron) for the backup of [sagou.in](sagou.in).
Refer to the [dedicated wiki page](https://wiki.rockpro.ynh.fr/tech:backup#autorestic).
Refer to the [dedicated wiki page](https://wiki.sagou.in/tech:backup#autorestic).
Once initialized, move the repository keys into a `.autorestic.env` file along the `yml` as described in [https://autorestic.vercel.app/backend/env](the doc).

View File

@ -6,7 +6,7 @@ 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 ]
if [ $(wc -l < /tmp/autorestic.log) -gt 3 ]
then
printf "Command successfully finished with the following log:\n$(cat /tmp/autorestic.log)" | mail -s "Autorestic Backup: Success" root
fi