Autorestic/runforget
2021-11-24 10:13:07 +01:00

10 lines
514 B
Bash
Executable File

#! /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