Friday, December 28, 2007

For whom the bells tolls

You cant un-ring a bell
The government will change the hour this 29th at midnight (or 30th at 0 hour) in order to save energy ( link 1, link 2, link 3, link 4 & link 5). This is the second time this year that I have to do this, so, I decided to post here the steps, which are really easy.
Many of the servers don't have internet access, or some of them are really old, besides, the updated tzdata from the vendor usually arrive after the change has taken place, that's why I have decided to write my own tzdata file.

Started by creating this text file. Buenos_Aires2.txt (I use tabs for separators):
Zone America/Argentina/Buenos_Aires2  -3:53:48 - LMT 1894 Oct 31
      -4:16:48 - CMT 1920 May # Cordoba Mean Time
      -4:00  - ART 1930 Dec
      -4:00  - ART 1969 Oct 5
      -3:00  - ART 1999 Oct 3
      -3:00  - ART 2000 Mar 3
      -4:00  - ART 2007 Dec 30
      -3:00  - ART


Then, open the Terminal, and type:

% zic -d tz_change Buenos_Aires2.txt


This will compile the new tzdata file, then, issue:

% sudo cp tz_change/America/Argentina/Buenos_Aires2 /usr/share/zoneinfo/America/Argentina/
% cd /usr/share/zoneinfo/America/Argentina/
% sudo cp Buenos_Aires Buenos_Aires.ORIG
% sudo mv Buenos_Aires2 Buenos_Aires
% cd /etc
% sudo cp localtime localtime.ORIG
% sudo ln -sf /usr/share/zoneinfo/America/Argentina/Buenos_Aires localtime


Then, you can test the new tzdata, like this:

zdump -v America/Argentina/Buenos_Aires


On the output, you'll see the lines that will make the hour change automagically:

America/Argentina/Buenos_Aires Sun Dec 30 03:59:59 2007 UTC = Sat Dec 29 23:59:59 2007 ART isdst=0
America/Argentina/Buenos_Aires Sun Dec 30 04:00:00 2007 UTC = Sun Dec 30 01:00:00 2007 ART isdst=0


At 12 midnight on the 29th, it will forward the hour to 1 AM; which is the change it will be taking place. Of course, you have to change the original text file to the location of your servers, and this does not take into consideration what will happen with the running services on the servers on which you change the hour.

Labels: , , , , ,

0 Comments:

Post a Comment

<< Home