offen / docker-volume-backup

Backup Docker volumes locally or to any S3, WebDAV, Azure Blob Storage, Dropbox or SSH compatible storage
https://offen.github.io/docker-volume-backup/
Mozilla Public License 2.0
2.09k stars 85 forks source link

Notification not sent, eventhough notification_level is set to info #490

Closed b-a0 closed 2 weeks ago

b-a0 commented 3 weeks ago

What are you trying to do?

I would like to receive a ntfy.sh notification on every backup run, regardless of failure or success. I've set the relevant environment variables, but I'm not getting any notifications. As there is no error either I am not sure how I can troubleshoot this further, I hope someone here might have some pointers.

What is your current configuration?

services:
  <some services>
  ...

  backup:
    container_name: nc_backup
    image: offen/docker-volume-backup:v2
    restart: always
    # see for config: https://offen.github.io/docker-volume-backup/reference/
    environment:
      - BACKUP_STOP_DURING_BACKUP_LABEL=ncbackup
      - NOTIFICATION_URLS=ntfy://ntfy.sh/my-unique-topic-id
      - NOTIFICATION_LEVEL=info
    env_file:
      - cred.env # Contains S3 credentials
    volumes:
      - ./backupconfig:/etc/dockervolumebackup/conf.d
      - /mnt/rpi2/ssd/backups:/archive:rw # local storage of backups
      - <volume1>:/backup/<volume1>:ro
      - <volume2>:/backup/<volume2>:ro
      - <volume3>:/backup/<volume3>:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro

volumes:
  <volume1>
  <volume2>
  <volume3>

Files in ./backupconfig:

# 01local.conf
BACKUP_CRON_EXPRESSION="0 2 */10 * *"
BACKUP_ARCHIVE="/archive"
BACKUP_FILENAME="nc-backup-%Y-%m-%dT%H-%M-%S.tar.gz"
BACKUP_RETENTION_DAYS="7"
BACKUP_PRUNING_PREFIX="nc-backup-"
# 02remote.conf
BACKUP_CRON_EXPRESSION="0 2 */14 * *"
# By picking a non-existing folder no local backup is stored
BACKUP_ARCHIVE="/nonexistingfolder"
BACKUP_FILENAME="nc-backup-%Y-%m-%dT%H-%M-%S.tar.gz"
BACKUP_RETENTION_DAYS="120"
BACKUP_PRUNING_PREFIX="nc-backup-"
AWS_ENDPOINT="s3.eu-central-003.backblazeb2.com"
AWS_S3_BUCKET_NAME="bucketname"

Log output

I get no notification (or error) after a backup is completed. Below is the output an ad-hoc run of the 02remote config:

$ docker compose exec backup /bin/sh -c 'set -a; source /etc/dockervolumebackup/conf.d/02remote.conf; set +a && backup'
time=2024-11-01T02:42:14.016+01:00 level=INFO msg="Stopping 3 out of 12 running container(s) as they were labeled docker-volume-backup.stop-during-backup=ncbackup."
time=2024-11-01T03:07:22.242+01:00 level=INFO msg="Created backup of `/backup` at `/tmp/nc-backup-2024-11-01T02-42-13.tar.gz`."
time=2024-11-01T03:07:24.929+01:00 level=INFO msg="Restarted 3 container(s)."
time=2024-11-01T10:43:03.719+01:00 level=INFO msg="Uploaded a copy of backup `/tmp/nc-backup-2024-11-01T02-42-13.tar.gz` to bucket `bucketname`." storage=S3
time=2024-11-01T10:43:03.742+01:00 level=INFO msg="None of 8 existing backups were pruned." storage=S3
time=2024-11-01T10:43:07.110+01:00 level=INFO msg="Removed tar file `/tmp/nc-backup-2024-11-01T02-42-13.tar.gz`."

Additional context

m90 commented 3 weeks ago

There's nothing obviously wrong with your configuration, so maybe for debugging this further a suitable next step would be to rule out ntfy misbehaving. To do so, could you maybe add another notification transport, e.g. email, and see if the notifications get sent on that channel?

In case no, we can dig into this further.

m90 commented 2 weeks ago

Closing this as stale. Feel free to reopen if you need further support.