Novell Home

Manage Daylight Savings Time With CRON.NLM

Novell Cool Solutions: Tip
By Steve Cantrill

Digg This - Slashdot This

Posted: 12 Feb 2002
 

Reader Steve Cantrill sent us this nifty CRONTAB file that helps him manage changes in time due to daylight savings. If you deal with daylight savings time in your part of the world, this tip was designed for you.

Use of CRON to alter server time for daylight savings:

I use the following CronTab to handle daylight savings semi-automatically. Note that CRON needs to be reloaded at least 1 hour after the fall adjustment. (I just reload it the next business day)

____________________________________________________________________
# F:\ETC\CRONTAB File for daylight savings adjustment and time log
# Spring: Set for 2002 4/7/02
# Fall: Set for 2002 10/27/02
#DOM = Day of month (1-31)
#Mo = Month (1-12 => 1 = January)
#DOW = Day of Week (0-6 => 0 = Sunday)
#
#Mn Hr DOM Mo DOW Command
#
# The following TWO lines log the time on the console twice a day
1 0 * * * Time
1 12 * * * Time
#
# Daylight Savings: Begins 2am 1st Sunday of April; Ends 2am last Sun of Oct
#
# The following 2 lines set the clock BACK an hour.
# Cron must be unloaded.
# for at least an hour after this so an infinite loop does not develop.
# Off Daylight savings 10/27/02 0200
0 2 27 10 * Set Time 1:00 am
0 2 27 10 * Unload cron
#
# The following 1 line sets the clock FORWARD an hour. 4/7/02 0200
0 2 7 4 * Set Time 3:00 am

You can learn more about CRON.NLM in this Technical Information Document: TID-2939440.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell