Added scripts to send mail with sucess or fail
This commit is contained in:
parent
9786e9df79
commit
001011ed76
@ -84,7 +84,7 @@ locations:
|
||||
- hdd
|
||||
cron: '0 3 * * 4' # At 3:00am on Thursday
|
||||
|
||||
home:
|
||||
multimedia:
|
||||
from:
|
||||
- /home/yunohost.multimedia/
|
||||
to:
|
||||
|
BIN
.runforget.swp
Normal file
BIN
.runforget.swp
Normal file
Binary file not shown.
13
runcron
Executable file
13
runcron
Executable file
@ -0,0 +1,13 @@
|
||||
#! /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
|
10
runforget
Executable file
10
runforget
Executable file
@ -0,0 +1,10 @@
|
||||
#! /usr/bin/env bash
|
||||
autorestic -c /etc/autorestic/.autorestic.yml --ci forget --all --prune 1> /tmp/autorestic-prune.log 2>/tmp/autorestic-prune-err.log
|
||||
ret=$?
|
||||
|
||||
if [ "$ret" != 0 ] || [ -s /tmp/autorestic-prune-err.log ]
|
||||
then
|
||||
printf "Command failed with return code $ret and log:\n$(cat /tmp/autorestic-prune-err.log)" | mail -s "Autorestic Pruning: Failed" root
|
||||
else
|
||||
printf "Command successfully finished with the following log:\n$(cat /tmp/autorestic-prune.log)" | mail -s "Autorestic Pruning: Success" root
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user