templates/docker-compose/ - update Borgmatics image
It's necessary to update to the `latest` image because the `latest-msmtp` image is now unmaintained and doesn't support postgres 17. However, this means we need to adjust things (the backup script and the environment variable config) because we need to use the latest notification mechanism, `apprise` instead of msmtp. Tested, seems to be working.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# Run the backup and mail the logs:
|
||||
# Depending on parameter 1:
|
||||
# - test-smtp: just send a test email to $MAIL_TO
|
||||
# - test-smtp: just send a test email using $APPRISE_URI
|
||||
# - run: create the backup, no checks
|
||||
# - check: prune, compact and check the backup
|
||||
# Anything else is an error.
|
||||
@@ -9,8 +9,6 @@
|
||||
set -o pipefail
|
||||
|
||||
# Set up environment
|
||||
/bin/sh /scripts/msmtprc.sh
|
||||
/bin/sh /scripts/env.sh
|
||||
RUN_COMMAND="borgmatic --stats -v 2 create"
|
||||
CHECK_COMMAND="borgmatic --stats -v 1 prune compact check"
|
||||
LOGFILE="/tmp/backup_run_$(date +%s).log"
|
||||
@@ -43,14 +41,12 @@ report() {
|
||||
log echo "FAILED: $RESULT"
|
||||
PREFIX="$FAILED_PREFIX"
|
||||
fi
|
||||
printf "Subject: %s: '%s'\n\n%s\n" "$PREFIX" "$PARAM" "$(cat $LOGFILE)" |
|
||||
sendmail -t "$MAIL_TO"
|
||||
apprise -vv -t "$PREFIX: '$PARAM'" -b "$(cat $LOGFILE)" "$APPRISE_URI&pass=$SMTP_PASSWORD"
|
||||
log echo "Report sent."
|
||||
}
|
||||
|
||||
testmail() {
|
||||
echo -e "Subject: TESTING!\n\ntest mail, please ignore\n" |
|
||||
sendmail -t "$MAIL_TO"
|
||||
apprise -vv -t "TESTING!" -b "test mail, please ignore." "$APPRISE_URI&pass=$SMTP_PASSWORD"
|
||||
}
|
||||
|
||||
failed() {
|
||||
@@ -72,7 +68,7 @@ trap cleanup EXIT
|
||||
|
||||
case "$PARAM" in
|
||||
test-smtp)
|
||||
echo "Testing mail to $MAIL_TO"
|
||||
echo "Testing mail to via Apprise ($APPRISE_URI)"
|
||||
testmail
|
||||
echo "Done."
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user