Fixed cron job sending useless mails
This commit is contained in:
2
runcron
2
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
|
||||
|
||||
Reference in New Issue
Block a user