Linux Timezone QuickTip

Recently, after moving to a different timezone, I noticed that my automated backup scripts were failing. Why? They were running based on the old timezone (during a disallowed time).

To update to the new timezone, specify the correct timezone in the directory path below:

cd /etc

sudo ln -sf /usr/share/zoneinfo/US/[yourzone] localtime
Issue the date command to see the new date/time/zone.

Logic:
/etc/localtime is a symbolic link to the correct timezone data as stored in /usr/share/zoneinfo.  Directories are also available for other countries within the zoneinfo directory.

0 comments: