[GH-ISSUE #25] [BUG] Wrong time written on backup file and in the Executions page #19

Closed
opened 2026-02-26 21:34:03 +03:00 by kerem · 4 comments
Owner

Originally created by @SpasovskiFilip on GitHub (Aug 10, 2024).
Original GitHub issue: https://github.com/eduardolat/pgbackweb/issues/25

It's not some feature breaking bug, but I just thought I'd report it, just in case.

First to clarify that the backup is executed at the desired time, there is no issue there.
The issue is that the time written on the backup file (both local and S3) and in the Executions page, doesn't match the time specified on the cron schedule according to the time zone I've set.

This is the setup I have for the backup with the cron and timezone it's set up at 5:20 AM
image

This is the executions page showing the backup time as 3:20 AM
image

And Here is the file on Cloudflare R2 storage with the time of 3:20 AM in the filename
image

P.S. Same goes for manual backup execution and local backup files.
Also I tried setting the TZ in the docker-compose file and redeploying, but it didn't change anything.

Originally created by @SpasovskiFilip on GitHub (Aug 10, 2024). Original GitHub issue: https://github.com/eduardolat/pgbackweb/issues/25 It's not some feature breaking bug, but I just thought I'd report it, just in case. First to clarify that the backup is executed at the desired time, there is no issue there. The issue is that the time written on the backup file (both local and S3) and in the Executions page, doesn't match the time specified on the cron schedule according to the time zone I've set. This is the setup I have for the backup with the cron and timezone it's set up at 5:20 AM ![image](https://github.com/user-attachments/assets/05a2e626-944d-4f7d-8d39-bcc13066c526) This is the executions page showing the backup time as 3:20 AM ![image](https://github.com/user-attachments/assets/4226d439-2cc1-4a23-9bd5-273dfd560c76) And Here is the file on Cloudflare R2 storage with the time of 3:20 AM in the filename ![image](https://github.com/user-attachments/assets/97601450-e3ee-4688-b32b-acee25a282fc) P.S. Same goes for manual backup execution and local backup files. Also I tried setting the TZ in the docker-compose file and redeploying, but it didn't change anything.
kerem closed this issue 2026-02-26 21:34:03 +03:00
Author
Owner

@julien-wff commented on GitHub (Aug 13, 2024):

Hi @SpasovskiFilip,

The name of the backup file is tied to the container's timezone. By default it's UTC. I just tested, setting the TZ env variable does modify the file name.
Can you give me your compose file? Also, are the logs on the same timezone as the one you specified?

image
image
image

<!-- gh-comment-id:2285937381 --> @julien-wff commented on GitHub (Aug 13, 2024): Hi @SpasovskiFilip, The name of the backup file is tied to the container's timezone. By default it's UTC. I just tested, setting the `TZ` env variable does modify the file name. Can you give me your compose file? Also, are the logs on the same timezone as the one you specified? ![image](https://github.com/user-attachments/assets/72dad3ed-cea5-458b-bd23-91047cdbffd8) ![image](https://github.com/user-attachments/assets/9933b024-3ac2-41d8-a0fa-5185686f882a) ![image](https://github.com/user-attachments/assets/1c365d17-34c3-451d-b0f2-337e39a10c7a)
Author
Owner

@SpasovskiFilip commented on GitHub (Aug 13, 2024):

I think I might have made a mistake, unknowingly.
The issue is I had the timezone written as TZ: Europe/Skopje instead of using quotes like you are using.

version: "3.9"
services:
  pgbackweb:
    image: eduardolat/pgbackweb:latest
    container_name: PGBackWeb
    healthcheck:
      test: timeout 10s bash -c ':> /dev/tcp/127.0.0.1/8085' || exit 1
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 90s
    ports:
      - 8085:8085
    volumes:
      - /volume1/docker/vaultwarden/backupdb/pgbackweb:/backups
    environment:
      TZ: Europe/Skopje
      PBW_ENCRYPTION_KEY: SOME_ENC_KEY
      PBW_POSTGRES_CONN_STRING: PG_CONN_STRING
    depends_on:
      pgbackweb-db:
        condition: service_healthy

  pgbackweb-db:
    image: postgres:16
    hostname: pgbackweb-db
    container_name: PGBackWeb-DB
    environment:
      POSTGRES_USER: pgbackwebuser
      POSTGRES_DB: pgbackweb
      POSTGRES_PASSWORD: pgbackwebpass
    ports:
      - 8086:5432
    volumes:
      - /volume1/docker/pgbackwebdb:/var/lib/postgresql/data:rw
    healthcheck:
      test: ["CMD", "pg_isready", "-q", "-d", "pgbackweb", "-U", "pgbackwebuser"]
      timeout: 45s
      interval: 10s
      retries: 10

After fixing this, the backup naming works great
The log also shows the correct time
The only place the time is still UTC is in the Executions page

<!-- gh-comment-id:2286118757 --> @SpasovskiFilip commented on GitHub (Aug 13, 2024): I think I might have made a mistake, unknowingly. The issue is I had the timezone written as `TZ: Europe/Skopje` instead of using quotes like you are using. ```yaml version: "3.9" services: pgbackweb: image: eduardolat/pgbackweb:latest container_name: PGBackWeb healthcheck: test: timeout 10s bash -c ':> /dev/tcp/127.0.0.1/8085' || exit 1 interval: 10s timeout: 5s retries: 3 start_period: 90s ports: - 8085:8085 volumes: - /volume1/docker/vaultwarden/backupdb/pgbackweb:/backups environment: TZ: Europe/Skopje PBW_ENCRYPTION_KEY: SOME_ENC_KEY PBW_POSTGRES_CONN_STRING: PG_CONN_STRING depends_on: pgbackweb-db: condition: service_healthy pgbackweb-db: image: postgres:16 hostname: pgbackweb-db container_name: PGBackWeb-DB environment: POSTGRES_USER: pgbackwebuser POSTGRES_DB: pgbackweb POSTGRES_PASSWORD: pgbackwebpass ports: - 8086:5432 volumes: - /volume1/docker/pgbackwebdb:/var/lib/postgresql/data:rw healthcheck: test: ["CMD", "pg_isready", "-q", "-d", "pgbackweb", "-U", "pgbackwebuser"] timeout: 45s interval: 10s retries: 10 ``` After fixing this, the backup naming works great The log also shows the correct time The only place the time is still UTC is in the Executions page
Author
Owner

@julien-wff commented on GitHub (Aug 13, 2024):

Happy to hear it's solved!

I've added a precision in #28, so people don't get confused.
Changing Execution page TZ will certainly be my next PR.

<!-- gh-comment-id:2286186025 --> @julien-wff commented on GitHub (Aug 13, 2024): Happy to hear it's solved! I've added a precision in #28, so people don't get confused. Changing Execution page TZ will certainly be my next PR.
Author
Owner

@julien-wff commented on GitHub (Aug 15, 2024):

This issue is resolved, it can be closed (@SpasovskiFilip, @eduardolat, since I don't have perms)

<!-- gh-comment-id:2291009317 --> @julien-wff commented on GitHub (Aug 15, 2024): This issue is resolved, it can be closed (@SpasovskiFilip, @eduardolat, since I don't have perms)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/pgbackweb#19
No description provided.