From 9c0586263fe6d612a957f46523bd0c5aec96cb17 Mon Sep 17 00:00:00 2001 From: Antoine Lima Date: Tue, 28 Dec 2021 23:43:02 +0000 Subject: [PATCH] Fixed cron job sending useless mails --- README.md | 3 ++- runcron | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7f566bc..2186ace 100644 --- a/README.md +++ b/README.md @@ -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). \ No newline at end of file +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). diff --git a/runcron b/runcron index 08e1e3f..4b20e4e 100755 --- a/runcron +++ b/runcron @@ -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