?
Solved

TIMEZONE - INTERPRETATION BY CRON

Posted on 2003-02-25
4
Medium Priority
?
822 Views
Last Modified: 2013-12-27
How does a CRON job refer to the timezone when starting to execute it?  

Say, I am in San Francisco (my timezone is PST).  I schedule a cron job to run at 01:35 AM everyday. On October 26 (the day on which PST becomes the effective taking into consideration day light savings switch), how many times does my cron job run on that specific day?  

In other words, how does cron determine the timezone according to which it needs to run scheduled jobs?
0
Comment
Question by:nsarathc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Expert Comment

by:dmaloy1
ID: 8017159
Through the definition in the /etc/default/init file.
0
 
LVL 5

Accepted Solution

by:
Nisus091197 earned 200 total points
ID: 8018830
Hi,

The system default timezone is defined by the TZ variable in the /etc/default/init file.  For backward compatibility /etc/TIMEZONE is a symlink to it.

The PST timezone does not adjust for daylight savings, you would need to use the PDT timezone.

The number of times the cronjob will run will depend on the timezone of your system and the exact time that the change will take place.

If your timezone is PST, the cron job will run once.  If you change it to PDT and the system clock changes between 01:35 and 02:35 then I imagine it will run twice.

It would be easy to verify.  Just use the date command to set the time to 01:30 on Oct. 26 and see what happens.  Try again with TZ=PDT in your /etc/default/init (don't forget to reboot).

Regards, Nisus
http://www.omnimodo.com
0
 
LVL 18

Expert Comment

by:liddler
ID: 10425955
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by Nisus

Please leave any comments here within the next four days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

liddler
EE Cleanup Volunteer
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question