stefanprodan / mgob

MongoDB dockerized backup agent. Runs schedule backups with retention, S3 & SFTP upload, notifications, instrumentation with Prometheus and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cron library supports timezones but tzdata missing from container

seanson opened this issue · comments

The cron library supports the environment variable TZ for setting a time zone but the local tzdata database is not installed by the Dockerfile. The fall-back behaviour is to silently ignore the TZ and switch to UTC so it is not a breaking change.

Tested locally with Docker tags edge and 1.0.

docker run -v ${PWD}/test.yml:/config/test.yml -e TZ=Australia/Sydney -ti stefanprodan/mgob:1.0
...
INFO[0000] mongodump version: v3.8.0-4224-gb44dad24a3 git version: b44dad24a3fd8873276233b76d1473114c3f4da8 Go version: go1.11.4    os: linux    arch: amd64    compiler: gc OpenSSL version: OpenSSL 1.1.1a  20 Nov 2018
...
INFO[0003] Next tmp cleanup run at 2019-06-18 01:00:00 +0000 UTC

With tzdata installed:

docker run -v ${PWD}/test.yml:/config/test.yml -e TZ=Australia/Sydney -ti mgob:test                                          ...
INFO[0000] mongodump version: v3.8.0-4224-gb44dad24a3 git version: b44dad24a3fd8873276233b76d1473114c3f4da8 Go version: go1.11.4    os: linux    arch: amd64    compiler: gc OpenSSL version: OpenSSL 1.1.1a  20 Nov 2018
...
INFO[0002] Next tmp cleanup run at 2019-06-18 11:00:00 +1000 AEST