Keeping Linux Timezone Updated When Travelling

Journeying through various timezones requires updates to the system timezone, otherwise NTP will stay synchronised with your "home" timezone.

Most OSs offer some NTP/GeoIP functionality to identify your current timezone by your IP, but running bare systems requires a CLI tool.

tzupdate does this for you. It can be installed from pip:

sudo pip install -U tzupdate

And run like so:

sudo tzupdate

By default, tzupdate will geolocate you, get the timezone for that geolocation, and then attempt to link that timezone to /etc/localtime. You can pass -p to print the detected timezone without linking. You can also pass -a to pass an IP address to use, instead of geolocating you.

This could be performed on a cron job, but to avoid potential failures in the mapping database is better performed manually.