Rclone in docker uses TZ as UTC not as provided

What is the problem you are having with rclone?

running rcone in docker.
My compose file provides environment for
- PUID=1000
- PGID=100
- TZ=Europe/Berlin

but all log date uses time stamp as UTC (currently 2 hrs less vs my timezone).
May be intended behavior, but makes log file confusing.

What is your rclone version (output from rclone version)

rclone v1.52.1

  • os/arch: linux/amd64
  • go version: go1.14.4

Which OS you are using and how many bits (eg Windows 7, 64 bit)

debian + docker

Which cloud storage system are you using? (eg Google Drive)

behavior is independent f the storage (all storages shows same).

The command you were trying to run (eg rclone copy /tmp remote:tmp)

docker exec -it rclone rclone sync --update --log-level INFO --log-file=backup_rclone.log localfile remotefile:

Pls note I run rclone as standard user, not root.

The rclone config contents with secrets removed.

type = local
nounc = true

A log from the command with the -vv flag

2020-06-14_11:16:03: local_file remote:local_file
2020/06/14 09:16:06 INFO  : There was nothing to transfer

Pls note in the log differences in time. First line through "echo", second from "rclone"

I think this will need the timezone database to be installed in the docker image.

Try apk add tzdata in the image and see if that fixes it.

That did the trick.

~$ docker exec -it rclone date
Mon Jun 15 16:46:26 UTC 2020
~$ docker exec -it rclone apk add tzdata
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
(1/1) Installing tzdata (2020a-r0)
Executing busybox-1.30.1-r2.trigger
OK: 10 MiB in 18 packages
~$ docker exec -it rclone date
Mon Jun 15 18:47:03 CEST 2020

Will this be fixed? Or should I run the command myself. No issues now that I know.

It can be added to the docker file quite easily here.

Fancy sending a pull request? Hopefully it won't make the docker image too much bigger!

I don't feel confident enough for a pull request (never done before). I'm afraid I'll create an issue rather trying to solve aone.

It's really easy. You simply add tzdata to the apk command @ncw highlighted. You need to try to understand git a bit, but all of this can be done directly from GitHub.

Anyhow, I went ahead and made one.

1 Like

Thanks - I merged it! It should be in the beta tagged docker builds in 15 mins or so!

1 Like

Thanks. As you said, very easy. Hope next time I'll have the courage and not afraid of breaking the code. :sweat_smile:

RUN apk --no-cache add ca-certificates fuse tzdata && \

Appreciate you went ahead and made the change.


Looks like it is working

$ docker pull rclone/rclone:beta
beta: Pulling from rclone/rclone
df20fa9351a1: Already exists 
eee8805c3a3f: Pull complete 
b1ebb02770d8: Pull complete 
2de222bdada8: Pull complete 
Digest: sha256:0f3c0f51e2bba5c5812a90f2cc6dc0bd09184c83ec1b41093f5d2c9bd512221d
Status: Downloaded newer image for rclone/rclone:beta

$ docker run --entrypoint /bin/sh -it rclone/rclone:beta
/data # TZ=Europe/Berlin date
Wed Jun 17 16:27:18 CEST 2020
/data # 

@ncw don't know how to express the BIG THANKS for fixing. May be was a very minor issue for everyone else (not seen reported before), but was driving me crazy.
You may want to close (or let be close automatically).

Glad it is fixed :slight_smile:

It even got released in v1.52.2 today!

If you'd like to express thanks in a financial way you could consider sponsoring the project?

Did a little sponsoring contribution to the project through PayPal.


Thank you - much appreciated :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.