databacker / mysql-backup

image to enable automated backups of mysql databases in containers
636 stars 178 forks source link

Environment Variable "DB_DUMP_FREQ" not backing up at the perscribed frequency #342

Closed skywalkerisnull closed 2 weeks ago

skywalkerisnull commented 2 weeks ago

In my docker compose file, I have the following config, the DB_DUMP_FREQ: 60 has no effect and it is defaulting to the value of 1440. I have found that using command: dump --frequency=60 does work.

  mysql-backup:
    image: databack/mysql-backup:1.0.0-rc5
    restart: always
    environment:
      DUMP: true
      DEBUG: true
      DB_SERVER: db
      DB_USER: ********
      DB_PASS: ************
      DB_NAMES: ************
      DB_DUMP_TARGET: s3://backups-******
      DB_DUMP_BEGIN:
      DB_DUMP_FREQ: 60 # hourly
      AWS_ACCESS_KEY_ID: ****
      AWS_SECRET_ACCESS_KEY: ******
      AWS_ENDPOINT_URL: https://s3.ap-southeast-2.amazonaws.com
      AWS_DEFAULT_REGION: ap-southeast-2
      AWS_REGION: ap-southeast-2
      COMPRESSION: gzip
      DB_DUMP_FILENAME_PATTERN: replica-{{.now}}.tgz
      DB_DUMP_DEBUG: true
      TZ: Australia/Sydney
      NICE: true
    command: dump

https://github.com/databacker/mysql-backup/issues/303#issuecomment-2309009069

deitch commented 2 weeks ago

Oops. It does work, but the docs are off. Wherever possible, the env vars match the flags, so --frequency is equivalent to DB_DUMP_FREQUENCY. I will update the docs, thanks for finding that.