Docker-sync: Bad Timezone on MacOSX High Sierra

Created on 2 Feb 2018  路  8Comments  路  Source: EugenMayer/docker-sync

Error/Feature Requestion/Docs

Hello,

I don't know if it will solve my sync problem with unison but I've noticed that the way timezone is passed to the sync containers is TZ=${TZ-`readlink /etc/localtime | sed -e 's,/usr/share/zoneinfo/,,'`} but on my MacOSX High Sierra 10.13.2 (17C205) the result of readlink /etc/localtime is /var/db/timezone/zoneinfo/Europe/Paris, so the timezone in the sync container is always wrong.

Docker Driver

Version 17.12.0-ce-mac49 (21995)

Sync strategy

unison

OS

OSX Version

bug

All 8 comments

Thats interesting and yes this can def cause sync issues due to the time.

The question now is, how to make this more stable - could we assume that the last part of the path is always the TZ? ( no matter which path ).

Under Sierra its

readlink /etc/localtime | sed -e 's,/usr/share/zoneinfo/,,'
Europe/Berlin

well it turns out that

basename `readlink /etc/localtime`
Berlin

Will not work either, we would need Europe/Berlin here. So i guess

Zone=basename $(dirname `readlink /etc/localtime`)
City=basename `readlink /etc/localtime`
echo "$Zone/$City"

would do it. AS one lines

echo $(basename $(dirname `readlink /etc/localtime`))/$(basename `readlink /etc/localtime`)

Could you test this?

i get

echo $(basename $(dirname `readlink /etc/localtime`))/$(basename `readlink /etc/localtime`)
Europe/Berlin

I get :

echo $(basename $(dirname `readlink /etc/localtime`))/$(basename `readlink /etc/localtime`)
Europe/Paris

That seems good ! :)

Not on High Sierra yet, but for me it gets Pacific/Auckland, which is correct.

i did not manage to release it yet, quiet busy times, sorry.

finally - thanks for the patience

We have way to much code duplication. You right, we want to fix that for all of those

fixed with 0.5.6

Was this page helpful?
0 / 5 - 0 ratings