Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timezone appears not to be working #347

Open
Hafnernuss opened this issue Aug 18, 2024 · 3 comments
Open

Timezone appears not to be working #347

Hafnernuss opened this issue Aug 18, 2024 · 3 comments

Comments

@Hafnernuss
Copy link

In my docker-compose file, I have set up the timezone as "Europe/Vienna":

environment:
      - TZ="Europe/Vienna"

with the folling in my config.yml file:

archive_name_format: 'myservice-files-{now:%Y-%m-%d_%H-%M-%S-%z}'

However, the backups are created in the following format:

myservice-files-2024-08-18T07:46:46+0000

Which appears to be plain UTC. Am I missing something here or is the TZ env not honored?

@modem7
Copy link
Member

modem7 commented Nov 25, 2024

What does docker exec -it Borgmatic date give you?

I've just checked on mine, and the TZ variable is definitely honoured.

@Bubbelb
Copy link
Contributor

Bubbelb commented Nov 26, 2024

Just a quick one: At my compose.yaml, the environment node is not an array, but a dict. So, maybe instead of your example above, lose the dash at the beginning, and replace the = by ': '. Like so:

environment:
      TZ: "Europe/Vienna"

This is the way it works for me.

@modem7
Copy link
Member

modem7 commented Nov 26, 2024

This is mine in case it's useful:

  #############
  ##Borgmatic##
  #############

  borgmatic:
    image: modem7/borgmatic-docker
    # image: modem7/borgmatic-docker:1.8.13-1.4.0
    # image: borgmatic:test
    # image: ghcr.io/borgmatic-collective/borgmatic
    container_name: Borgmatic
    environment:
      TZ: $TZ # Europe/London
      BORG_PASSPHRASE: $BORG_PASSPHRASE
      BORG_SOURCE_1: $BORG_SOURCE_1
      BORG_SOURCE_2: $BORG_SOURCE_2
      BORG_REPO: $BORG_REPO
      BORG_HEALTHCHECK_URL: $BORG_HEALTHCHECK_URL
      # EXTRA_PKGS: postgresql16-client rclone coreutils jq
      DOCKERCLI: true
      CRON: $BORG_CRON
      CRON_COMMAND: $BORG_CRON_COMMAND
      # EXTRA_CRON: |-
      #   @daily borgmatic check -v 1 2>&1 > tee /mnt/log/check-$(date +\%Y-\%m-\%dT\%H:\%M:\%S).log
      #   0 7 1 * * command2
    logging:
      driver: "local"
      options:
        max-size: 10m
        max-file: "3"
    volumes:
      - $BORGHOMESOURCEDIR:/mnt/source/
      # - $CRONTAB:/mnt/source/Cron
      # - Pihole:/mnt/source/Pihole/Pihole
      # - Dnsmasq:/mnt/source/Pihole/Dnsmasq
      - $BORGSERVBACKUPDIR/Database:/mnt/borg-DBrepository
      - $BORGSERVBACKUPDIR/Docker:/mnt/borg-repository
      - $RAMDRIVEBACKUP/borg:/mnt/ramdrive
      - $USERDIR:/mnt/source/DockerApps/
      - $USERDIR/Borgmatic/borgmatic.d/:/etc/borgmatic.d/
      - $USERDIR/Borgmatic/.config/borg/:/root/.config/borg
      - $USERDIR/Borgmatic/.ssh/:/root/.ssh
      - $USERDIR/Borgmatic/.state/:/root/.borgmatic
      - $USERDIR/Borgmatic/.cache/borg/:/root/.cache/borg
      - $DOCKERDIR/HDA/.env:/mnt/docker/HDA/.env:ro
      - $DOCKERDIR/HDA/docker-compose.yml:/mnt/docker/HDA/docker-compose.yml:ro
      - $BORGSCRIPTS:/borgscripts:ro
      - /var/run/docker.sock:/var/run/docker.sock # So we can run scripts
      # - /mnt/downloads/script/:/custom-cont-init.d:ro
    networks:
      isonet:
      isolated:
    restart: always

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants