{ "created": "2015-12-20T19:56:46Z", "hierarchy": [ { "name": "ROOT", "type": "folder", "uri": "/ROOT" }, { "name": "NTP Notes", "type": "article", "uri": "NTP_Notes" } ], "html": "\n\n \n \n \n \n\n \n \n\n \n \n \n \n \n\n NTP Notes\n\n \n \n \n \n
\n
\n \n
\n
\n \n \n\n\n

NTP Notes

\n\n

[TOC]

\n

Mostly for RHEL5 systems. Should work on any Linux distro.

\n

Preliminary notes

\n

The config for ntpd is /etc/ntp.conf. These lines are of interest:

\n
server 0.centos.pool.ntp.org  \nserver 1.centos.pool.ntp.org  \nserver 2.centos.pool.ntp.org\n
\n

They must be changed to whatever you have in mind for NTP servers.\nImportant: You must also include these servers in the\n/etc/ntp/step-tickers file! This file will be found initially empty.\nIf you don’t, you’ll see something like this when restarting the NTP\ndaemon:

\n
[root@localhost ntp]# /sbin/service ntpd start\nntpd: Synchronizing with time server:            [FAILED]\nStarting ntpd:                                   [  OK  ]\n
\n

The NTP port is 123 and must be open in your iptables rules to allow\nsynchronization.

\n

The University of Iowa NTP servers

\n

As mentioned earlier, these need to be in the step-tickers file.

\n
ntp1.uiowa.edu  \nntp2.uiowa.edu  \nntp3.uiowa.edu\n
\n

How Time Zones work in Linux

\n

Important: The NTP servers do not provide timezone-specific data!\nAll they provide is UTC time. This data is then adjusted by ntpd in\nconjunction with /etc/localtime.

\n

The /etc/localtime file has a list of the zone offsets (going till\n2038; the 32-bit problem) and, importantly, the dates on which the clock\nis moved forward and backward (for the Daylight Savings crap.) To see\nthe contents of this file, you have to use zdump:

\n
zdump -v /etc/localtime | grep 2010\n
\n

This will show how the clock is adjusted w.r.t. timezone and DST:

\n
/etc/localtime  Sun Mar 14 07:59:59 2010 UTC = Sun Mar 14 01:59:59 2010 CST isdst=0 gmtoff=-21600  \n/etc/localtime  Sun Mar 14 08:00:00 2010 UTC = Sun Mar 14 03:00:00 2010 CDT isdst=1 gmtoff=-18000  \n/etc/localtime  Sun Nov  7 06:59:59 2010 UTC = Sun Nov  7 01:59:59 2010 CDT isdst=1 gmtoff=-18000  \n/etc/localtime  Sun Nov  7 07:00:00 2010 UTC = Sun Nov  7 01:00:00 2010 CST isdst=0 gmtoff=-21600\n
\n

Comprehensive timezone resources are located in /usr/share/zoneinfo.\nIt’s the directory utilized by, for example, Anaconda to set your\ntimezone at install. Here’s a sample tree view of the contents of this\nfolder.

\n
America  \n|-- Anguilla  \n|-- Antigua  \n|-- Araguaina  \n|-- Argentina  \n|   |-- Buenos_Aires  \n|   |-- Catamarca  \n|   |-- ComodRivadavia  \n|   |-- Cordoba  \n|   |-- Jujuy  \n|   |-- La_Rioja  \n|   |-- Mendoza  \n|   |-- Rio_Gallegos  \n|   |-- Salta  \n|   |-- San_Juan  \n|   |-- San_Luis  \n|   |-- Tucuman  \n|   -- Ushuaia   \n|-- Aruba  \n|-- Asuncion  \n|-- Atikokan  \n.  \n.  \n.\n
\n

To manually adjust your timezone, you just need to symlink the correct\nresource file to /etc/localtime.

\n

For US zones, the naming scheme is slightly weird. Here’s a table of\nfiles for four US timezones. They are at the root of\n/usr/share/zoneinfo

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Time ZoneFile in /usr/share/zoneinfo
EasternEST5EDT
CentralCST6CDT
MountainMST7MDT
PacificPST8PDT
\n

Again, use zdump to view/verify these files.

\n

Adjusting Time Zones

\n

The simple way

\n

You just have to symlink the correct time resource file to\n/etc/localtime. For instance, if I’m in the America/Chicago timezone:

\n
mv /etc/localtime /etc/localtime.backup  \nln -s /usr/share/zoneinfo/America/Chicago /etc/localtime  \nservice ntpd restart\n
\n

tzselect

\n

If you don’t want to bother with pesky symlinking to update\n/etc/localtime, you can always use tzselect. It’s a small,\ninteractive command-line utility which will generate a string like this\nthat you can add to ~/.bash_profile

\n
TZ='Africa/Porto-Novo'; export TZ\n
\n

Fixing Daylight Savings Issues

\n

A zdump of the /etc/localtime file will yield what the local system\ndoes at certain dates.

\n
zdump -v /etc/localtime\n
\n

Look at the output. If you see the correct dates for Daylight Savings,\nyou’re good. For example,

\n
/etc/localtime  Sun Mar 14 07:59:59 2010 UTC = Sun Mar 14 01:59:59 2010 CST isdst=0 gmtoff=-21600  \n/etc/localtime  Sun Mar 14 08:00:00 2010 UTC = Sun Mar 14 03:00:00 2010 CDT isdst=1 gmtoff=-18000  \n/etc/localtime  Sun Nov  7 06:59:59 2010 UTC = Sun Nov  7 01:59:59 2010 CDT isdst=1 gmtoff=-18000  \n/etc/localtime  Sun Nov  7 07:00:00 2010 UTC = Sun Nov  7 01:00:00 2010 CST isdst=0 gmtoff=-21600\n
\n

Which seems correct, since the time jumped ahead an hour on March 14.\nBut here’s some worrisome output:

\n
/etc/localtime  Sun Apr  4 07:59:59 2010 UTC = Sun Apr  4 01:59:59 2010 CST isdst=0 gmtoff=-21600\n/etc/localtime  Sun Apr  4 08:00:00 2010 UTC = Sun Apr  4 03:00:00 2010 CDT isdst=1 gmtoff=-18000\n/etc/localtime  Sun Oct 31 06:59:59 2010 UTC = Sun Oct 31 01:59:59 2010 CDT isdst=1 gmtoff=-18000\n/etc/localtime  Sun Oct 31 07:00:00 2010 UTC = Sun Oct 31 01:00:00 2010 CST isdst=0 gmtoff=-21600\n
\n

In this case, you’ll need to update the timezone files in\n/usr/share/zoneinfo.

\n

Note: The timezone files are all compiled with zic

\n

The easy way - Use YUM

\n

One way to do it is to update the tzdata RPM.

\n
yum update tzdata\n
\n

This should fetch and install the correct files.

\n

The hard way - Compile with Zic

\n

Download the latest data. This is the file as of 2010:

\n
wget ftp://elsie.nci.nih.gov/pub/tzdata2010f.tar.gz\n
\n

They don’t extract to a directory, so make sure you create one! Now\ncompile zone files using zic with this syntax:

\n
zic -d <directory to extract to> <name of zone file>\n
\n

Let’s try it for North America. The file to compile is called\nnorthamerica. Let’s compile the results to tempdir

\n
zic -d tempdir northamerica\n
\n

Now verify that the newly compiled files have the correct DST offsets:

\n
[root@localhost tempdir]# zdump -v tempdir/CST6CDT | grep 2010  \nCST6CDT  Sun Mar 14 07:59:59 2010 UTC = Sun Mar 14 01:59:59 2010 CST isdst=0 gmtoff=-21600  \nCST6CDT  Sun Mar 14 08:00:00 2010 UTC = Sun Mar 14 03:00:00 2010 CDT isdst=1 gmtoff=-18000  \nCST6CDT  Sun Nov  7 06:59:59 2010 UTC = Sun Nov  7 01:59:59 2010 CDT isdst=1 gmtoff=-18000  \nCST6CDT  Sun Nov  7 07:00:00 2010 UTC = Sun Nov  7 01:00:00 2010 CST isdst=0 gmtoff=-21600\n
\n

Woohoo! Now you can copy these over to /usr/share/zoneinfo:

\n
[root@localhost tempdir]# cp -r * /usr/share/zoneinfo/\n
\n

Now remove the old /etc/localtime and symlink the newly compiled zone\nfile:

\n
[root@localhost tempdir]# rm -f /etc/localtime  \n[root@localhost tempdir]# ln -s /usr/share/zoneinfo/CST6CDT /etc/localtime\n
\n

Restart ntpd and you’re good to go!

\n

Resources

\n
    \n
  1. Update Linux and FreeBSD systems for new Daylight Saving Time\nsetting
  2. \n
  3. Date, Time and Time Zones for Red Hat\nLinux - Excellent\noverview of NTP and date and time utilities.
  4. \n
\n\n\n
\n \n
\n \n \n \n \n \n\n", "id": "76c0e19b-ed00-5091-b80f-7b38fc23e34c", "modified": "2022-06-13T23:23:48Z", "revisions": [ { "authorEmail": "mail@nikhil.io", "authorName": "Nikhil Anand", "date": "2022-06-13T23:23:48Z", "id": "6be928c4c8de048934c03e3c61539c9ceec7d59a", "shortId": "6be928c4", "subject": "Update config.yml", "content": "[TOC]\n\nMostly for RHEL5 systems. Should work on any Linux distro.\n\nPreliminary notes\n-----------------\n\nThe config for `ntpd` is `/etc/ntp.conf`. These lines are of interest:\n\n server 0.centos.pool.ntp.org \n server 1.centos.pool.ntp.org \n server 2.centos.pool.ntp.org\n\nThey must be changed to whatever you have in mind for NTP servers.\n**Important**: You *must* also include these servers in the\n`/etc/ntp/step-tickers` file! This file will be found initially empty.\nIf you don't, you'll see something like this when restarting the NTP\ndaemon:\n\n [root@localhost ntp]# /sbin/service ntpd start\n ntpd: Synchronizing with time server:            [FAILED]\n Starting ntpd:                                   [  OK  ]\n\nThe NTP port is **123** and must be open in your iptables rules to allow\nsynchronization.\n\nThe University of Iowa NTP servers\n----------------------------------\n\nAs mentioned earlier, these need to be in the `step-tickers` file.\n\n ntp1.uiowa.edu \n ntp2.uiowa.edu \n ntp3.uiowa.edu\n\nHow Time Zones work in Linux\n----------------------------\n\n**Important**: The NTP servers do *not* provide timezone-specific data!\nAll they provide is UTC time. This data is then adjusted by `ntpd` in\nconjunction with `/etc/localtime`.\n\nThe `/etc/localtime` file has a list of the zone offsets (going till\n2038; the 32-bit problem) and, importantly, the dates on which the clock\nis moved forward and backward (for the Daylight Savings crap.) To see\nthe contents of this file, you have to use `zdump`:\n\n zdump -v /etc/localtime | grep 2010\n\nThis will show how the clock is adjusted w.r.t. timezone and DST:\n\n /etc/localtime  Sun Mar 14 07:59:59 2010 UTC = Sun Mar 14 01:59:59 2010 CST isdst=0 gmtoff=-21600 \n /etc/localtime  Sun Mar 14 08:00:00 2010 UTC = Sun Mar 14 03:00:00 2010 CDT isdst=1 gmtoff=-18000 \n /etc/localtime  Sun Nov  7 06:59:59 2010 UTC = Sun Nov  7 01:59:59 2010 CDT isdst=1 gmtoff=-18000 \n /etc/localtime  Sun Nov  7 07:00:00 2010 UTC = Sun Nov  7 01:00:00 2010 CST isdst=0 gmtoff=-21600\n\nComprehensive timezone resources are located in `/usr/share/zoneinfo`.\nIt's the directory utilized by, for example, Anaconda to set your\ntimezone at install. Here's a sample tree view of the contents of this\nfolder.\n\n America \n |-- Anguilla \n |-- Antigua \n |-- Araguaina \n |-- Argentina \n |   |-- Buenos_Aires \n |   |-- Catamarca \n |   |-- ComodRivadavia \n |   |-- Cordoba \n |   |-- Jujuy \n |   |-- La_Rioja \n |   |-- Mendoza \n |   |-- Rio_Gallegos \n |   |-- Salta \n |   |-- San_Juan \n |   |-- San_Luis \n |   |-- Tucuman \n |   -- Ushuaia \n |-- Aruba \n |-- Asuncion \n |-- Atikokan \n . \n . \n .\n\nTo manually adjust your timezone, you just need to symlink the correct\nresource file to `/etc/localtime`.\n\nFor US zones, the naming scheme is slightly weird. Here's a table of\nfiles for four US timezones. They are at the root of\n`/usr/share/zoneinfo`\n\n| Time Zone | File in `/usr/share/zoneinfo` |\n|-----------|-------------------------------|\n| Eastern | `EST5EDT` |\n| Central | `CST6CDT` |\n| Mountain | `MST7MDT` |\n| Pacific | `PST8PDT` |\n\nAgain, use `zdump` to view/verify these files.\n\nAdjusting Time Zones\n--------------------\n\n### The simple way\n\nYou just have to symlink the correct time resource file to\n`/etc/localtime`. For instance, if I'm in the America/Chicago timezone:\n\n mv /etc/localtime /etc/localtime.backup \n ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime \n service ntpd restart\n\n### tzselect\n\nIf you don't want to bother with pesky symlinking to update\n`/etc/localtime`, you can always use `tzselect`. It's a small,\ninteractive command-line utility which will generate a string like this\nthat you can add to `~/.bash_profile`\n\n TZ='Africa/Porto-Novo'; export TZ\n\nFixing Daylight Savings Issues\n------------------------------\n\nA `zdump` of the `/etc/localtime` file will yield what the local system\ndoes at certain dates.\n\n zdump -v /etc/localtime\n\nLook at the output. If you see the correct dates for Daylight Savings,\nyou're good. For example,\n\n /etc/localtime  Sun Mar 14 07:59:59 2010 UTC = Sun Mar 14 01:59:59 2010 CST isdst=0 gmtoff=-21600 \n /etc/localtime  Sun Mar 14 08:00:00 2010 UTC = Sun Mar 14 03:00:00 2010 CDT isdst=1 gmtoff=-18000 \n /etc/localtime  Sun Nov  7 06:59:59 2010 UTC = Sun Nov  7 01:59:59 2010 CDT isdst=1 gmtoff=-18000 \n /etc/localtime  Sun Nov  7 07:00:00 2010 UTC = Sun Nov  7 01:00:00 2010 CST isdst=0 gmtoff=-21600\n\nWhich seems correct, since the time jumped ahead an hour on March 14.\nBut here's some worrisome output:\n\n /etc/localtime Sun Apr 4 07:59:59 2010 UTC = Sun Apr 4 01:59:59 2010 CST isdst=0 gmtoff=-21600\n /etc/localtime Sun Apr 4 08:00:00 2010 UTC = Sun Apr 4 03:00:00 2010 CDT isdst=1 gmtoff=-18000\n /etc/localtime Sun Oct 31 06:59:59 2010 UTC = Sun Oct 31 01:59:59 2010 CDT isdst=1 gmtoff=-18000\n /etc/localtime Sun Oct 31 07:00:00 2010 UTC = Sun Oct 31 01:00:00 2010 CST isdst=0 gmtoff=-21600\n\nIn this case, you'll need to update the timezone files in\n`/usr/share/zoneinfo`.\n\n**Note:** The timezone files are all compiled with [`zic`](http://www.gsp.com/cgi-bin/man.cgi?section=8&topic=zic)\n\n### The easy way - Use YUM\n\nOne way to do it is to update the `tzdata` RPM.\n\n yum update tzdata\n\nThis should fetch and install the correct files.\n\n### The hard way - Compile with Zic\n\nDownload the latest data. This is the file as of 2010:\n\n wget ftp://elsie.nci.nih.gov/pub/tzdata2010f.tar.gz\n\nThey don't extract to a directory, so make sure you create one! Now\ncompile zone files using `zic` with this syntax:\n\n zic -d  \n\nLet's try it for North America. The file to compile is called\n`northamerica`. Let's compile the results to `tempdir`\n\n zic -d tempdir northamerica\n\nNow verify that the newly compiled files have the correct DST offsets:\n\n [root@localhost tempdir]# zdump -v tempdir/CST6CDT | grep 2010 \n CST6CDT  Sun Mar 14 07:59:59 2010 UTC = Sun Mar 14 01:59:59 2010 CST isdst=0 gmtoff=-21600 \n CST6CDT  Sun Mar 14 08:00:00 2010 UTC = Sun Mar 14 03:00:00 2010 CDT isdst=1 gmtoff=-18000 \n CST6CDT  Sun Nov  7 06:59:59 2010 UTC = Sun Nov  7 01:59:59 2010 CDT isdst=1 gmtoff=-18000 \n CST6CDT  Sun Nov  7 07:00:00 2010 UTC = Sun Nov  7 01:00:00 2010 CST isdst=0 gmtoff=-21600\n\nWoohoo! Now you can copy these over to `/usr/share/zoneinfo`:\n\n [root@localhost tempdir]# cp -r * /usr/share/zoneinfo/\n\nNow remove the old `/etc/localtime` and symlink the newly compiled zone\nfile:\n\n [root@localhost tempdir]# rm -f /etc/localtime \n [root@localhost tempdir]# ln -s /usr/share/zoneinfo/CST6CDT /etc/localtime\n\nRestart `ntpd` and you're good to go!\n\nResources\n---------\n\n1. [Update Linux and FreeBSD systems for new Daylight Saving Time\n setting](http://articles.techrepublic.com.com/5100-10878_11-6163042.html)\n2. [Date, Time and Time Zones for Red Hat\n Linux](http://www.vanemery.com/Linux/RH-Linux-Time.html) - Excellent\n overview of NTP and date and time utilities.\n" }, { "authorEmail": "mail@nikhil.io", "authorName": "Nikhil Anand", "date": "2015-12-27T07:27:56Z", "id": "5a5b1a32f41081d062ab86f8869a961bcad79668", "shortId": "5a5b1a32", "subject": "Fix Markdown conversion\n\nSaw half a season of The Office\n", "content": "[TOC]\n\nMostly for RHEL5 systems. Should work on any Linux distro.\n\nPreliminary notes\n-----------------\n\nThe config for `ntpd` is `/etc/ntp.conf`. These lines are of interest:\n\n server 0.centos.pool.ntp.org \n server 1.centos.pool.ntp.org \n server 2.centos.pool.ntp.org\n\nThey must be changed to whatever you have in mind for NTP servers.\n**Important**: You *must* also include these servers in the\n`/etc/ntp/step-tickers` file! This file will be found initially empty.\nIf you don't, you'll see something like this when restarting the NTP\ndaemon:\n\n [root@localhost ntp]# /sbin/service ntpd start\n ntpd: Synchronizing with time server:            [FAILED]\n Starting ntpd:                                   [  OK  ]\n\nThe NTP port is **123** and must be open in your iptables rules to allow\nsynchronization.\n\nThe University of Iowa NTP servers\n----------------------------------\n\nAs mentioned earlier, these need to be in the `step-tickers` file.\n\n ntp1.uiowa.edu \n ntp2.uiowa.edu \n ntp3.uiowa.edu\n\nHow Time Zones work in Linux\n----------------------------\n\n**Important**: The NTP servers do *not* provide timezone-specific data!\nAll they provide is UTC time. This data is then adjusted by `ntpd` in\nconjunction with `/etc/localtime`.\n\nThe `/etc/localtime` file has a list of the zone offsets (going till\n2038; the 32-bit problem) and, importantly, the dates on which the clock\nis moved forward and backward (for the Daylight Savings crap.) To see\nthe contents of this file, you have to use `zdump`:\n\n zdump -v /etc/localtime | grep 2010\n\nThis will show how the clock is adjusted w.r.t. timezone and DST:\n\n /etc/localtime  Sun Mar 14 07:59:59 2010 UTC = Sun Mar 14 01:59:59 2010 CST isdst=0 gmtoff=-21600 \n /etc/localtime  Sun Mar 14 08:00:00 2010 UTC = Sun Mar 14 03:00:00 2010 CDT isdst=1 gmtoff=-18000 \n /etc/localtime  Sun Nov  7 06:59:59 2010 UTC = Sun Nov  7 01:59:59 2010 CDT isdst=1 gmtoff=-18000 \n /etc/localtime  Sun Nov  7 07:00:00 2010 UTC = Sun Nov  7 01:00:00 2010 CST isdst=0 gmtoff=-21600\n\nComprehensive timezone resources are located in `/usr/share/zoneinfo`.\nIt's the directory utilized by, for example, Anaconda to set your\ntimezone at install. Here's a sample tree view of the contents of this\nfolder.\n\n America \n |-- Anguilla \n |-- Antigua \n |-- Araguaina \n |-- Argentina \n |   |-- Buenos_Aires \n |   |-- Catamarca \n |   |-- ComodRivadavia \n |   |-- Cordoba \n |   |-- Jujuy \n |   |-- La_Rioja \n |   |-- Mendoza \n |   |-- Rio_Gallegos \n |   |-- Salta \n |   |-- San_Juan \n |   |-- San_Luis \n |   |-- Tucuman \n |   -- Ushuaia \n |-- Aruba \n |-- Asuncion \n |-- Atikokan \n . \n . \n .\n\nTo manually adjust your timezone, you just need to symlink the correct\nresource file to `/etc/localtime`.\n\nFor US zones, the naming scheme is slightly weird. Here's a table of\nfiles for four US timezones. They are at the root of\n`/usr/share/zoneinfo`\n\n| Time Zone | File in `/usr/share/zoneinfo` |\n|-----------|-------------------------------|\n| Eastern | `EST5EDT` |\n| Central | `CST6CDT` |\n| Mountain | `MST7MDT` |\n| Pacific | `PST8PDT` |\n\nAgain, use `zdump` to view/verify these files.\n\nAdjusting Time Zones\n--------------------\n\n### The simple way\n\nYou just have to symlink the correct time resource file to\n`/etc/localtime`. For instance, if I'm in the America/Chicago timezone:\n\n mv /etc/localtime /etc/localtime.backup \n ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime \n service ntpd restart\n\n### tzselect\n\nIf you don't want to bother with pesky symlinking to update\n`/etc/localtime`, you can always use `tzselect`. It's a small,\ninteractive command-line utility which will generate a string like this\nthat you can add to `~/.bash_profile`\n\n TZ='Africa/Porto-Novo'; export TZ\n\nFixing Daylight Savings Issues\n------------------------------\n\nA `zdump` of the `/etc/localtime` file will yield what the local system\ndoes at certain dates.\n\n zdump -v /etc/localtime\n\nLook at the output. If you see the correct dates for Daylight Savings,\nyou're good. For example,\n\n /etc/localtime  Sun Mar 14 07:59:59 2010 UTC = Sun Mar 14 01:59:59 2010 CST isdst=0 gmtoff=-21600 \n /etc/localtime  Sun Mar 14 08:00:00 2010 UTC = Sun Mar 14 03:00:00 2010 CDT isdst=1 gmtoff=-18000 \n /etc/localtime  Sun Nov  7 06:59:59 2010 UTC = Sun Nov  7 01:59:59 2010 CDT isdst=1 gmtoff=-18000 \n /etc/localtime  Sun Nov  7 07:00:00 2010 UTC = Sun Nov  7 01:00:00 2010 CST isdst=0 gmtoff=-21600\n\nWhich seems correct, since the time jumped ahead an hour on March 14.\nBut here's some worrisome output:\n\n /etc/localtime Sun Apr 4 07:59:59 2010 UTC = Sun Apr 4 01:59:59 2010 CST isdst=0 gmtoff=-21600\n /etc/localtime Sun Apr 4 08:00:00 2010 UTC = Sun Apr 4 03:00:00 2010 CDT isdst=1 gmtoff=-18000\n /etc/localtime Sun Oct 31 06:59:59 2010 UTC = Sun Oct 31 01:59:59 2010 CDT isdst=1 gmtoff=-18000\n /etc/localtime Sun Oct 31 07:00:00 2010 UTC = Sun Oct 31 01:00:00 2010 CST isdst=0 gmtoff=-21600\n\nIn this case, you'll need to update the timezone files in\n`/usr/share/zoneinfo`.\n\n**Note:** The timezone files are all compiled with [`zic`](http://www.gsp.com/cgi-bin/man.cgi?section=8&topic=zic)\n\n### The easy way - Use YUM\n\nOne way to do it is to update the `tzdata` RPM.\n\n yum update tzdata\n\nThis should fetch and install the correct files.\n\n### The hard way - Compile with Zic\n\nDownload the latest data. This is the file as of 2010:\n\n wget ftp://elsie.nci.nih.gov/pub/tzdata2010f.tar.gz\n\nThey don't extract to a directory, so make sure you create one! Now\ncompile zone files using `zic` with this syntax:\n\n zic -d  \n\nLet's try it for North America. The file to compile is called\n`northamerica`. Let's compile the results to `tempdir`\n\n zic -d tempdir northamerica\n\nNow verify that the newly compiled files have the correct DST offsets:\n\n [root@localhost tempdir]# zdump -v tempdir/CST6CDT | grep 2010 \n CST6CDT  Sun Mar 14 07:59:59 2010 UTC = Sun Mar 14 01:59:59 2010 CST isdst=0 gmtoff=-21600 \n CST6CDT  Sun Mar 14 08:00:00 2010 UTC = Sun Mar 14 03:00:00 2010 CDT isdst=1 gmtoff=-18000 \n CST6CDT  Sun Nov  7 06:59:59 2010 UTC = Sun Nov  7 01:59:59 2010 CDT isdst=1 gmtoff=-18000 \n CST6CDT  Sun Nov  7 07:00:00 2010 UTC = Sun Nov  7 01:00:00 2010 CST isdst=0 gmtoff=-21600\n\nWoohoo! Now you can copy these over to `/usr/share/zoneinfo`:\n\n [root@localhost tempdir]# cp -r * /usr/share/zoneinfo/\n\nNow remove the old `/etc/localtime` and symlink the newly compiled zone\nfile:\n\n [root@localhost tempdir]# rm -f /etc/localtime \n [root@localhost tempdir]# ln -s /usr/share/zoneinfo/CST6CDT /etc/localtime\n\nRestart `ntpd` and you're good to go!\n\nResources\n---------\n\n1. [Update Linux and FreeBSD systems for new Daylight Saving Time\n setting](http://articles.techrepublic.com.com/5100-10878_11-6163042.html)\n2. [Date, Time and Time Zones for Red Hat\n Linux](http://www.vanemery.com/Linux/RH-Linux-Time.html) - Excellent\n overview of NTP and date and time utilities.\n" }, { "authorEmail": "mail@nikhil.io", "authorName": "Nikhil Anand", "date": "2015-12-21T02:30:47Z", "id": "3f2c54b1d767218fcb4855fbac306b015afaf551", "shortId": "3f2c54b1", "subject": "Incremental\n", "content": "Mostly for RHEL5 systems. Should work on any Linux distro.\n\nPreliminary notes\n-----------------\n\nThe config for `ntpd` is `/etc/ntp.conf`. These lines are of interest:\n\n server 0.centos.pool.ntp.org \n server 1.centos.pool.ntp.org \n server 2.centos.pool.ntp.org\n\nThey must be changed to whatever you have in mind for NTP servers.\n**Important**: You *must* also include these servers in the\n`/etc/ntp/step-tickers` file! This file will be found initially empty.\nIf you don't, you'll see something like this when restarting the NTP\ndaemon:\n\n [root@localhost ntp]# /sbin/service ntpd start\n ntpd: Synchronizing with time server:            [FAILED]\n Starting ntpd:                                   [  OK  ]\n\nThe NTP port is **123** and must be open in your iptables rules to allow\nsynchronization.\n\nThe University of Iowa NTP servers\n----------------------------------\n\nAs mentioned earlier, these need to be in the `step-tickers` file.\n\n` ntp1.uiowa.edu` \n` ntp2.uiowa.edu` \n` ntp3.uiowa.edu`\n\nHow Time Zones work in Linux\n----------------------------\n\n**Important**: The NTP servers do *not* provide timezone-specific data!\nAll they provide is UTC time. This data is then adjusted by `ntpd` in\nconjunction with `/etc/localtime`.\n\nThe `/etc/localtime` file has a list of the zone offsets (going till\n2038; the 32-bit problem) and, importantly, the dates on which the clock\nis moved forward and backward (for the Daylight Savings crap.) To see\nthe contents of this file, you have to use `zdump`:\n\n` zdump -v /etc/localtime | grep 2010`\n\nThis will show how the clock is adjusted w.r.t. timezone and DST:\n\n`/etc/localtime  Sun Mar 14 07:59:59 2010 UTC = Sun Mar 14 01:59:59 2010 CST isdst=0 gmtoff=-21600` \n`/etc/localtime  Sun Mar 14 08:00:00 2010 UTC = Sun Mar 14 03:00:00 2010 CDT isdst=1 gmtoff=-18000` \n`/etc/localtime  Sun Nov  7 06:59:59 2010 UTC = Sun Nov  7 01:59:59 2010 CDT isdst=1 gmtoff=-18000` \n`/etc/localtime  Sun Nov  7 07:00:00 2010 UTC = Sun Nov  7 01:00:00 2010 CST isdst=0 gmtoff=-21600`\n\nComprehensive timezone resources are located in `/usr/share/zoneinfo`.\nIt's the directory utilized by, for example, Anaconda to set your\ntimezone at install. Here's a sample tree view of the contents of this\nfolder.\n\n` America` \n` |-- Anguilla` \n` |-- Antigua` \n` |-- Araguaina` \n` |-- Argentina` \n` |   |-- Buenos_Aires` \n` |   |-- Catamarca` \n` |   |-- ComodRivadavia` \n` |   |-- Cordoba` \n` |   |-- Jujuy` \n` |   |-- La_Rioja` \n` |   |-- Mendoza` \n` |   |-- Rio_Gallegos` \n` |   |-- Salta` \n` |   |-- San_Juan` \n` |   |-- San_Luis` \n` |   |-- Tucuman` \n``  |   `-- Ushuaia `` \n` |-- Aruba` \n` |-- Asuncion` \n` |-- Atikokan` \n` .` \n` .` \n` .`\n\nTo manually adjust your timezone, you just need to symlink the correct\nresource file to `/etc/localtime`.\n\nFor US zones, the naming scheme is slightly weird. Here's a table of\nfiles for four US timezones. They are at the root of\n`/usr/share/zoneinfo`\n\n| Time Zone | File in /usr/share/zoneinfo |---- | Eastern | EST5EDT |---- | Central | CST6CDT |---- | Mountain | MST7MDT |---- | Pacific | PST8PDT |---- |\n|-----------|-----------------------------------|---------|---------------|---------|---------------|----------|---------------|---------|---------------|\n\nAgain, use `zdump` to view/verify these files.\n\nAdjusting Time Zones\n--------------------\n\n### The simple way\n\nYou just have to symlink the correct time resource file to\n`/etc/localtime`. For instance, if I'm in the America/Chicago timezone:\n\n` mv /etc/localtime /etc/localtime.backup` \n` ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime` \n` service ntpd restart`\n\n### tzselect\n\nIf you don't want to bother with pesky symlinking to update\n`/etc/localtime`, you can always use `tzselect`. It's a small,\ninteractive command-line utility which will generate a string like this\nthat you can add to `~/.bash_profile`\n\n` TZ='Africa/Porto-Novo'; export TZ`\n\nFixing Daylight Savings Issues\n------------------------------\n\nA `zdump` of the `/etc/localtime` file will yield what the local system\ndoes at certain dates.\n\n` zdump -v /etc/localtime`\n\nLook at the output. If you see the correct dates for Daylight Savings,\nyou're good. For example,\n\n` /etc/localtime  Sun Mar 14 07:59:59 2010 UTC = Sun Mar 14 01:59:59 2010 CST isdst=0 gmtoff=-21600` \n` /etc/localtime  Sun Mar 14 08:00:00 2010 UTC = Sun Mar 14 03:00:00 2010 CDT isdst=1 gmtoff=-18000` \n` /etc/localtime  Sun Nov  7 06:59:59 2010 UTC = Sun Nov  7 01:59:59 2010 CDT isdst=1 gmtoff=-18000` \n` /etc/localtime  Sun Nov  7 07:00:00 2010 UTC = Sun Nov  7 01:00:00 2010 CST isdst=0 gmtoff=-21600`\n\nWhich seems correct, since the time jumped ahead an hour on March 14.\nBut here's some worrisome output:\n\n` /etc/localtime  Sun `**`Apr`\n`4`**` 07:59:59 2010 UTC = Sun Apr  4 01:59:59 2010 CST isdst=0 gmtoff=-21600` \n` /etc/localtime  Sun `**`Apr`\n`4`**` 08:00:00 2010 UTC = Sun Apr  4 03:00:00 2010 CDT isdst=1 gmtoff=-18000` \n` /etc/localtime  Sun `**`Oct`\n`31`**` 06:59:59 2010 UTC = Sun Oct 31 01:59:59 2010 CDT isdst=1 gmtoff=-18000` \n` /etc/localtime  Sun `**`Oct`\n`31`**` 07:00:00 2010 UTC = Sun Oct 31 01:00:00 2010 CST isdst=0 gmtoff=-21600`\n\nIn this case, you'll need to update the timezone files in\n`/usr/share/zoneinfo`.\n\n**Note:** The timezone files are all compiled with `'''zic'''`:\n\n\n### The easy way - Use YUM\n\nOne way to do it is to update the `tzdata` RPM.\n\n` yum update tzdata`\n\nThis should fetch and install the correct files.\n\n### The hard way - Compile with Zic\n\nDownload the latest data. This is the file as of 2010:\n\n` wget '`[`ftp://elsie.nci.nih.gov/pub/tzdata2010f.tar.gz`](ftp://elsie.nci.nih.gov/pub/tzdata2010f.tar.gz)`'`\n\nThey don't extract to a directory, so make sure you create one! Now\ncompile zone files using `zic` with this syntax:\n\n` zic -d `` `\n\nLet's try it for North America. The file to compile is called\n`northamerica`. Let's compile the results to `tempdir`\n\n` zic -d tempdir northamerica`\n\nNow verify that the newly compiled files have the correct DST offsets:\n\n` [root@localhost tempdir]# zdump -v tempdir/CST6CDT | grep 2010` \n` CST6CDT  Sun Mar 14 07:59:59 2010 UTC = Sun Mar 14 01:59:59 2010 CST isdst=0 gmtoff=-21600` \n` CST6CDT  Sun Mar 14 08:00:00 2010 UTC = Sun Mar 14 03:00:00 2010 CDT isdst=1 gmtoff=-18000` \n` CST6CDT  Sun Nov  7 06:59:59 2010 UTC = Sun Nov  7 01:59:59 2010 CDT isdst=1 gmtoff=-18000` \n` CST6CDT  Sun Nov  7 07:00:00 2010 UTC = Sun Nov  7 01:00:00 2010 CST isdst=0 gmtoff=-21600`\n\nWoohoo! Now you can copy these over to `/usr/share/zoneinfo`:\n\n` [root@localhost tempdir]# cp -r * /usr/share/zoneinfo/`\n\nNow remove the old `/etc/localtime` and symlink the newly compiled zone\nfile:\n\n` [root@localhost tempdir]# rm -f /etc/localtime` \n` [root@localhost tempdir]# ln -s /usr/share/zoneinfo/CST6CDT /etc/localtime`\n\nRestart `ntpd` and you're good to go!\n\nResources\n---------\n\n1. [Update Linux and FreeBSD systems for new Daylight Saving Time\n setting](http://articles.techrepublic.com.com/5100-10878_11-6163042.html)\n2. [Date, Time and Time Zones for Red Hat\n Linux](http://www.vanemery.com/Linux/RH-Linux-Time.html) - Excellent\n overview of NTP and date and time utilities.\n\n\n\n" }, { "authorEmail": "mail@nikhil.io", "authorName": "Nikhil Anand", "date": "2015-12-20T19:56:46Z", "id": "17fb6c256abdc187c1a5f1d040c627d5ce107693", "shortId": "17fb6c25", "subject": "NTP Notes : First Draft", "content": "Mostly for RHEL5 systems. Should work on any Linux distro.\n\nPreliminary notes\n-----------------\n\nThe config for `ntpd` is `/etc/ntp.conf`. These lines are of interest:\n\n`  server 0.centos.pool.ntp.org` \n`  server 1.centos.pool.ntp.org` \n`  server 2.centos.pool.ntp.org`\n\nThey must be changed to whatever you have in mind for NTP servers.\n**Important**: You *must* also include these servers in the\n`/etc/ntp/step-tickers` file! This file will be found initially empty.\nIf you don't, you'll see something like this when restarting the NTP\ndaemon:\n\n` [root@localhost ntp]# /sbin/service ntpd start` \n` ntpd: Synchronizing with time server:            [FAILED]` \n` Starting ntpd:                                   [  OK  ]`\n\nThe NTP port is **123** and must be open in your iptables rules to allow\nsynchronization.\n\nThe University of Iowa NTP servers\n----------------------------------\n\nAs mentioned earlier, these need to be in the `step-tickers` file.\n\n` ntp1.uiowa.edu` \n` ntp2.uiowa.edu` \n` ntp3.uiowa.edu`\n\nHow Time Zones work in Linux\n----------------------------\n\n**Important**: The NTP servers do *not* provide timezone-specific data!\nAll they provide is UTC time. This data is then adjusted by `ntpd` in\nconjunction with `/etc/localtime`.\n\nThe `/etc/localtime` file has a list of the zone offsets (going till\n2038; the 32-bit problem) and, importantly, the dates on which the clock\nis moved forward and backward (for the Daylight Savings crap.) To see\nthe contents of this file, you have to use `zdump`:\n\n` zdump -v /etc/localtime | grep 2010`\n\nThis will show how the clock is adjusted w.r.t. timezone and DST:\n\n`/etc/localtime  Sun Mar 14 07:59:59 2010 UTC = Sun Mar 14 01:59:59 2010 CST isdst=0 gmtoff=-21600` \n`/etc/localtime  Sun Mar 14 08:00:00 2010 UTC = Sun Mar 14 03:00:00 2010 CDT isdst=1 gmtoff=-18000` \n`/etc/localtime  Sun Nov  7 06:59:59 2010 UTC = Sun Nov  7 01:59:59 2010 CDT isdst=1 gmtoff=-18000` \n`/etc/localtime  Sun Nov  7 07:00:00 2010 UTC = Sun Nov  7 01:00:00 2010 CST isdst=0 gmtoff=-21600`\n\nComprehensive timezone resources are located in `/usr/share/zoneinfo`.\nIt's the directory utilized by, for example, Anaconda to set your\ntimezone at install. Here's a sample tree view of the contents of this\nfolder.\n\n` America` \n` |-- Anguilla` \n` |-- Antigua` \n` |-- Araguaina` \n` |-- Argentina` \n` |   |-- Buenos_Aires` \n` |   |-- Catamarca` \n` |   |-- ComodRivadavia` \n` |   |-- Cordoba` \n` |   |-- Jujuy` \n` |   |-- La_Rioja` \n` |   |-- Mendoza` \n` |   |-- Rio_Gallegos` \n` |   |-- Salta` \n` |   |-- San_Juan` \n` |   |-- San_Luis` \n` |   |-- Tucuman` \n``  |   `-- Ushuaia `` \n` |-- Aruba` \n` |-- Asuncion` \n` |-- Atikokan` \n` .` \n` .` \n` .`\n\nTo manually adjust your timezone, you just need to symlink the correct\nresource file to `/etc/localtime`.\n\nFor US zones, the naming scheme is slightly weird. Here's a table of\nfiles for four US timezones. They are at the root of\n`/usr/share/zoneinfo`\n\n| Time Zone | File in /usr/share/zoneinfo |---- | Eastern | EST5EDT |---- | Central | CST6CDT |---- | Mountain | MST7MDT |---- | Pacific | PST8PDT |---- |\n|-----------|-----------------------------------|---------|---------------|---------|---------------|----------|---------------|---------|---------------|\n\nAgain, use `zdump` to view/verify these files.\n\nAdjusting Time Zones\n--------------------\n\n### The simple way\n\nYou just have to symlink the correct time resource file to\n`/etc/localtime`. For instance, if I'm in the America/Chicago timezone:\n\n` mv /etc/localtime /etc/localtime.backup` \n` ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime` \n` service ntpd restart`\n\n### tzselect\n\nIf you don't want to bother with pesky symlinking to update\n`/etc/localtime`, you can always use `tzselect`. It's a small,\ninteractive command-line utility which will generate a string like this\nthat you can add to `~/.bash_profile`\n\n` TZ='Africa/Porto-Novo'; export TZ`\n\nFixing Daylight Savings Issues\n------------------------------\n\nA `zdump` of the `/etc/localtime` file will yield what the local system\ndoes at certain dates.\n\n` zdump -v /etc/localtime`\n\nLook at the output. If you see the correct dates for Daylight Savings,\nyou're good. For example,\n\n` /etc/localtime  Sun Mar 14 07:59:59 2010 UTC = Sun Mar 14 01:59:59 2010 CST isdst=0 gmtoff=-21600` \n` /etc/localtime  Sun Mar 14 08:00:00 2010 UTC = Sun Mar 14 03:00:00 2010 CDT isdst=1 gmtoff=-18000` \n` /etc/localtime  Sun Nov  7 06:59:59 2010 UTC = Sun Nov  7 01:59:59 2010 CDT isdst=1 gmtoff=-18000` \n` /etc/localtime  Sun Nov  7 07:00:00 2010 UTC = Sun Nov  7 01:00:00 2010 CST isdst=0 gmtoff=-21600`\n\nWhich seems correct, since the time jumped ahead an hour on March 14.\nBut here's some worrisome output:\n\n` /etc/localtime  Sun `**`Apr`\n`4`**` 07:59:59 2010 UTC = Sun Apr  4 01:59:59 2010 CST isdst=0 gmtoff=-21600` \n` /etc/localtime  Sun `**`Apr`\n`4`**` 08:00:00 2010 UTC = Sun Apr  4 03:00:00 2010 CDT isdst=1 gmtoff=-18000` \n` /etc/localtime  Sun `**`Oct`\n`31`**` 06:59:59 2010 UTC = Sun Oct 31 01:59:59 2010 CDT isdst=1 gmtoff=-18000` \n` /etc/localtime  Sun `**`Oct`\n`31`**` 07:00:00 2010 UTC = Sun Oct 31 01:00:00 2010 CST isdst=0 gmtoff=-21600`\n\nIn this case, you'll need to update the timezone files in\n`/usr/share/zoneinfo`.\n\n**Note:** The timezone files are all compiled with `'''zic'''`:\n\n\n### The easy way - Use YUM\n\nOne way to do it is to update the `tzdata` RPM.\n\n` yum update tzdata`\n\nThis should fetch and install the correct files.\n\n### The hard way - Compile with Zic\n\nDownload the latest data. This is the file as of 2010:\n\n` wget '`[`ftp://elsie.nci.nih.gov/pub/tzdata2010f.tar.gz`](ftp://elsie.nci.nih.gov/pub/tzdata2010f.tar.gz)`'`\n\nThey don't extract to a directory, so make sure you create one! Now\ncompile zone files using `zic` with this syntax:\n\n` zic -d `` `\n\nLet's try it for North America. The file to compile is called\n`northamerica`. Let's compile the results to `tempdir`\n\n` zic -d tempdir northamerica`\n\nNow verify that the newly compiled files have the correct DST offsets:\n\n` [root@localhost tempdir]# zdump -v tempdir/CST6CDT | grep 2010` \n` CST6CDT  Sun Mar 14 07:59:59 2010 UTC = Sun Mar 14 01:59:59 2010 CST isdst=0 gmtoff=-21600` \n` CST6CDT  Sun Mar 14 08:00:00 2010 UTC = Sun Mar 14 03:00:00 2010 CDT isdst=1 gmtoff=-18000` \n` CST6CDT  Sun Nov  7 06:59:59 2010 UTC = Sun Nov  7 01:59:59 2010 CDT isdst=1 gmtoff=-18000` \n` CST6CDT  Sun Nov  7 07:00:00 2010 UTC = Sun Nov  7 01:00:00 2010 CST isdst=0 gmtoff=-21600`\n\nWoohoo! Now you can copy these over to `/usr/share/zoneinfo`:\n\n` [root@localhost tempdir]# cp -r * /usr/share/zoneinfo/`\n\nNow remove the old `/etc/localtime` and symlink the newly compiled zone\nfile:\n\n` [root@localhost tempdir]# rm -f /etc/localtime` \n` [root@localhost tempdir]# ln -s /usr/share/zoneinfo/CST6CDT /etc/localtime`\n\nRestart `ntpd` and you're good to go!\n\nResources\n---------\n\n1. [Update Linux and FreeBSD systems for new Daylight Saving Time\n setting](http://articles.techrepublic.com.com/5100-10878_11-6163042.html)\n2. [Date, Time and Time Zones for Red Hat\n Linux](http://www.vanemery.com/Linux/RH-Linux-Time.html) - Excellent\n overview of NTP and date and time utilities.\n\n[Category:Nikhil's Notes](Category:Nikhil's_Notes \"wikilink\")\n[Category:From a past sysadmin\nlife](Category:From_a_past_sysadmin_life \"wikilink\")\n" } ], "sizeInBytes": 7577, "source": "[TOC]\n\nMostly for RHEL5 systems. Should work on any Linux distro.\n\nPreliminary notes\n-----------------\n\nThe config for `ntpd` is `/etc/ntp.conf`. These lines are of interest:\n\n server 0.centos.pool.ntp.org \n server 1.centos.pool.ntp.org \n server 2.centos.pool.ntp.org\n\nThey must be changed to whatever you have in mind for NTP servers.\n**Important**: You *must* also include these servers in the\n`/etc/ntp/step-tickers` file! This file will be found initially empty.\nIf you don't, you'll see something like this when restarting the NTP\ndaemon:\n\n [root@localhost ntp]# /sbin/service ntpd start\n ntpd: Synchronizing with time server:            [FAILED]\n Starting ntpd:                                   [  OK  ]\n\nThe NTP port is **123** and must be open in your iptables rules to allow\nsynchronization.\n\nThe University of Iowa NTP servers\n----------------------------------\n\nAs mentioned earlier, these need to be in the `step-tickers` file.\n\n ntp1.uiowa.edu \n ntp2.uiowa.edu \n ntp3.uiowa.edu\n\nHow Time Zones work in Linux\n----------------------------\n\n**Important**: The NTP servers do *not* provide timezone-specific data!\nAll they provide is UTC time. This data is then adjusted by `ntpd` in\nconjunction with `/etc/localtime`.\n\nThe `/etc/localtime` file has a list of the zone offsets (going till\n2038; the 32-bit problem) and, importantly, the dates on which the clock\nis moved forward and backward (for the Daylight Savings crap.) To see\nthe contents of this file, you have to use `zdump`:\n\n zdump -v /etc/localtime | grep 2010\n\nThis will show how the clock is adjusted w.r.t. timezone and DST:\n\n /etc/localtime  Sun Mar 14 07:59:59 2010 UTC = Sun Mar 14 01:59:59 2010 CST isdst=0 gmtoff=-21600 \n /etc/localtime  Sun Mar 14 08:00:00 2010 UTC = Sun Mar 14 03:00:00 2010 CDT isdst=1 gmtoff=-18000 \n /etc/localtime  Sun Nov  7 06:59:59 2010 UTC = Sun Nov  7 01:59:59 2010 CDT isdst=1 gmtoff=-18000 \n /etc/localtime  Sun Nov  7 07:00:00 2010 UTC = Sun Nov  7 01:00:00 2010 CST isdst=0 gmtoff=-21600\n\nComprehensive timezone resources are located in `/usr/share/zoneinfo`.\nIt's the directory utilized by, for example, Anaconda to set your\ntimezone at install. Here's a sample tree view of the contents of this\nfolder.\n\n America \n |-- Anguilla \n |-- Antigua \n |-- Araguaina \n |-- Argentina \n |   |-- Buenos_Aires \n |   |-- Catamarca \n |   |-- ComodRivadavia \n |   |-- Cordoba \n |   |-- Jujuy \n |   |-- La_Rioja \n |   |-- Mendoza \n |   |-- Rio_Gallegos \n |   |-- Salta \n |   |-- San_Juan \n |   |-- San_Luis \n |   |-- Tucuman \n |   -- Ushuaia \n |-- Aruba \n |-- Asuncion \n |-- Atikokan \n . \n . \n .\n\nTo manually adjust your timezone, you just need to symlink the correct\nresource file to `/etc/localtime`.\n\nFor US zones, the naming scheme is slightly weird. Here's a table of\nfiles for four US timezones. They are at the root of\n`/usr/share/zoneinfo`\n\n| Time Zone | File in `/usr/share/zoneinfo` |\n|-----------|-------------------------------|\n| Eastern | `EST5EDT` |\n| Central | `CST6CDT` |\n| Mountain | `MST7MDT` |\n| Pacific | `PST8PDT` |\n\nAgain, use `zdump` to view/verify these files.\n\nAdjusting Time Zones\n--------------------\n\n### The simple way\n\nYou just have to symlink the correct time resource file to\n`/etc/localtime`. For instance, if I'm in the America/Chicago timezone:\n\n mv /etc/localtime /etc/localtime.backup \n ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime \n service ntpd restart\n\n### tzselect\n\nIf you don't want to bother with pesky symlinking to update\n`/etc/localtime`, you can always use `tzselect`. It's a small,\ninteractive command-line utility which will generate a string like this\nthat you can add to `~/.bash_profile`\n\n TZ='Africa/Porto-Novo'; export TZ\n\nFixing Daylight Savings Issues\n------------------------------\n\nA `zdump` of the `/etc/localtime` file will yield what the local system\ndoes at certain dates.\n\n zdump -v /etc/localtime\n\nLook at the output. If you see the correct dates for Daylight Savings,\nyou're good. For example,\n\n /etc/localtime  Sun Mar 14 07:59:59 2010 UTC = Sun Mar 14 01:59:59 2010 CST isdst=0 gmtoff=-21600 \n /etc/localtime  Sun Mar 14 08:00:00 2010 UTC = Sun Mar 14 03:00:00 2010 CDT isdst=1 gmtoff=-18000 \n /etc/localtime  Sun Nov  7 06:59:59 2010 UTC = Sun Nov  7 01:59:59 2010 CDT isdst=1 gmtoff=-18000 \n /etc/localtime  Sun Nov  7 07:00:00 2010 UTC = Sun Nov  7 01:00:00 2010 CST isdst=0 gmtoff=-21600\n\nWhich seems correct, since the time jumped ahead an hour on March 14.\nBut here's some worrisome output:\n\n /etc/localtime Sun Apr 4 07:59:59 2010 UTC = Sun Apr 4 01:59:59 2010 CST isdst=0 gmtoff=-21600\n /etc/localtime Sun Apr 4 08:00:00 2010 UTC = Sun Apr 4 03:00:00 2010 CDT isdst=1 gmtoff=-18000\n /etc/localtime Sun Oct 31 06:59:59 2010 UTC = Sun Oct 31 01:59:59 2010 CDT isdst=1 gmtoff=-18000\n /etc/localtime Sun Oct 31 07:00:00 2010 UTC = Sun Oct 31 01:00:00 2010 CST isdst=0 gmtoff=-21600\n\nIn this case, you'll need to update the timezone files in\n`/usr/share/zoneinfo`.\n\n**Note:** The timezone files are all compiled with [`zic`](http://www.gsp.com/cgi-bin/man.cgi?section=8&topic=zic)\n\n### The easy way - Use YUM\n\nOne way to do it is to update the `tzdata` RPM.\n\n yum update tzdata\n\nThis should fetch and install the correct files.\n\n### The hard way - Compile with Zic\n\nDownload the latest data. This is the file as of 2010:\n\n wget ftp://elsie.nci.nih.gov/pub/tzdata2010f.tar.gz\n\nThey don't extract to a directory, so make sure you create one! Now\ncompile zone files using `zic` with this syntax:\n\n zic -d  \n\nLet's try it for North America. The file to compile is called\n`northamerica`. Let's compile the results to `tempdir`\n\n zic -d tempdir northamerica\n\nNow verify that the newly compiled files have the correct DST offsets:\n\n [root@localhost tempdir]# zdump -v tempdir/CST6CDT | grep 2010 \n CST6CDT  Sun Mar 14 07:59:59 2010 UTC = Sun Mar 14 01:59:59 2010 CST isdst=0 gmtoff=-21600 \n CST6CDT  Sun Mar 14 08:00:00 2010 UTC = Sun Mar 14 03:00:00 2010 CDT isdst=1 gmtoff=-18000 \n CST6CDT  Sun Nov  7 06:59:59 2010 UTC = Sun Nov  7 01:59:59 2010 CDT isdst=1 gmtoff=-18000 \n CST6CDT  Sun Nov  7 07:00:00 2010 UTC = Sun Nov  7 01:00:00 2010 CST isdst=0 gmtoff=-21600\n\nWoohoo! Now you can copy these over to `/usr/share/zoneinfo`:\n\n [root@localhost tempdir]# cp -r * /usr/share/zoneinfo/\n\nNow remove the old `/etc/localtime` and symlink the newly compiled zone\nfile:\n\n [root@localhost tempdir]# rm -f /etc/localtime \n [root@localhost tempdir]# ln -s /usr/share/zoneinfo/CST6CDT /etc/localtime\n\nRestart `ntpd` and you're good to go!\n\nResources\n---------\n\n1. [Update Linux and FreeBSD systems for new Daylight Saving Time\n setting](http://articles.techrepublic.com.com/5100-10878_11-6163042.html)\n2. [Date, Time and Time Zones for Red Hat\n Linux](http://www.vanemery.com/Linux/RH-Linux-Time.html) - Excellent\n overview of NTP and date and time utilities.\n", "title": "NTP Notes", "untracked": false, "uri": "/NTP_Notes" }