diff options
Diffstat (limited to 'lifeboat')
-rwxr-xr-x | lifeboat | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -18,6 +18,22 @@ usage() { exit 1 } +report_backup() { + cd "$LIFEBOAT_ROOT/$repo" + + test -r config/recipient || errx "Could not read recipient from config/recipient" + read -r recipient < config/recipient + test -n "$recipient" || errx "No recipient given in config/recipient" + + cat <<-EOF | sendmail "$recipient" + From: Lifeboat <lifeboat@$(hostname -f)> + Subject: lifeboat: backup for $(hostname) on $(date) + X-Report: lifeboat + + $(run_backup 2>&1) + EOF +} + run_backup() { cd "$LIFEBOAT_ROOT/$repo" @@ -75,5 +91,6 @@ export RESTIC_PASSWORD_FILE=$LIFEBOAT_ROOT/$repo/credentials/restic case "$1" in run) run_backup;; + run-report) report_backup;; *) restic "$@";; esac |