Compare commits
2 Commits
9eab1fc5d3
...
b9bbbe7d55
| Author | SHA1 | Date | |
|---|---|---|---|
| b9bbbe7d55 | |||
| b839038784 |
@@ -113,6 +113,17 @@ locations:
|
|||||||
- glacier
|
- glacier
|
||||||
cron: '0 3 * * 4' # At 3:00am on Thursday
|
cron: '0 3 * * 4' # At 3:00am on Thursday
|
||||||
|
|
||||||
|
bookstack:
|
||||||
|
from:
|
||||||
|
- /var/www/bookstack/.env
|
||||||
|
- /var/www/bookstack/public/uploads
|
||||||
|
- /var/www/bookstack/storage/uploads
|
||||||
|
to:
|
||||||
|
- hdd
|
||||||
|
- oiseauroch
|
||||||
|
- glacier
|
||||||
|
cron: '0 3 * * 4' # At 3:00am on Thursday
|
||||||
|
|
||||||
mail:
|
mail:
|
||||||
from:
|
from:
|
||||||
- /var/mail
|
- /var/mail
|
||||||
|
|||||||
10
runcron
10
runcron
@@ -1,13 +1,13 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
autorestic -c /etc/autorestic/.autorestic.yml --ci cron --lean 1> /tmp/autorestic.log 2>/tmp/autorestic-err.log
|
autorestic -c /etc/autorestic/.autorestic.yml --ci cron 1> /tmp/autorestic.log 2>/tmp/autorestic-err.log
|
||||||
ret=$?
|
ret=$?
|
||||||
|
|
||||||
if [ "$ret" != 0 ] || [ -s /tmp/autorestic-err.log ]
|
if [[ "$ret" != 0 || -s /tmp/autorestic-err.log ]]
|
||||||
then
|
then
|
||||||
cat <(echo -e "Command failed with return code $ret and log:") /tmp/autorestic-err.log | mail -s "Autorestic Backup: Failed" root
|
cat <(echo "Command failed with return code $ret and log:") /tmp/tmp/autorestic-err.log <(echo "===============") /tmp/autorestic.log | mail -s "Autorestic Backup: Failed" root
|
||||||
else
|
else
|
||||||
if [ $(wc -l < /tmp/autorestic.log) -gt 3 ]
|
if [[ $(wc -l < /tmp/autorestic.log) -gt 15 ]]
|
||||||
then
|
then
|
||||||
cat <(echo -e "Command successfully finished with the following log:") /tmp/autorestic.log | mail -s "Autorestic Backup: Success" root
|
cat <(echo -e "Command successfully finished with the following log:") /tmp/tmp/autorestic-err.log <(echo "===============") /tmp/autorestic.log | mail -s "Autorestic Backup: Success" root
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
autorestic -c /etc/autorestic/.autorestic.yml --ci forget --all --prune 1> /tmp/autorestic-prune.log 2>/tmp/autorestic-prune-err.log
|
autorestic -c /etc/autorestic/.autorestic.yml --ci forget --all --prune 1> /tmp/autorestic-prune.log 2>/tmp/autorestic-prune-err.log
|
||||||
ret=$?
|
ret=$?
|
||||||
|
|
||||||
if [ "$ret" != 0 ] || [ -s /tmp/autorestic-prune-err.log ]
|
if [[ "$ret" != 0 || -s /tmp/autorestic-prune-err.log ]]
|
||||||
then
|
then
|
||||||
cat <(echo -e "Command failed with return code $ret and log:") /tmp/autorestic-prune-err.log | mail -s "Autorestic Pruning: Failed" root
|
cat <(echo "Command failed with return code $ret and log:") /tmp/autorestic-prune-err.log <(echo "===============") /tmp/autorestic-prune.log | mail -s "Autorestic Pruning: Failed" root
|
||||||
else
|
else
|
||||||
cat <(echo -e "Command successfully finished with the following log:") /tmp/autorestic-prune.log | mail -s "Autorestic Pruning: Success" root
|
cat <(echo "Command successfully finished with the following log:") /tmp/autorestic-prune.log | mail -s "Autorestic Pruning: Success" root
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user