Bug 83433 - Cron should interpret crontab TZ environment settings properly
Cron should interpret crontab TZ environment settings properly
Status: CLOSED CANTFIX
Product: Red Hat Linux
Classification: Retired
Component: vixie-cron (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jason Vas Dias
Brock Organ
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-02-04 00:23 EST by jw1233219
Modified: 2007-04-18 12:50 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-10-18 10:36:02 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to make crontab TZ settings affect scheduler (3.97 KB, patch)
2003-02-04 00:25 EST, jw1233219
no flags Details | Diff

  None (edit)
Description jw1233219 2003-02-04 00:23:20 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows 98; hahaha-fooled you!
This is really Mozilla/5.0 on Linux i686 rv:1.0.1 Gecko/2002103)

Description of problem:
It should be possible to put timezone settings in a crontab and have cron
schedule events according to the specified zone.

For example, suppose you wish to scrape a web page during NY hours of 8:30 EST
thru 16:00 EST.  It is difficult to set a time of day in a crontab when computer
is in a different time zone.  Either zone might change to/from daylight saving
for example (esp where hemispheres are different).

Should be able to have a crontab viz:

TZ=America/New_York
0 13 * * * date
TZ=""    # back to local time
0 13 * * * date


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. See above
2.
3.
    

Actual Results:  Both evens run at same time - 13:00 localtime.



Expected Results:  First even should run at 13:00 NY time.
Second event should run at 13:00 local time.


Additional info:

I have a patch.  This is more an enhancement than anything else.
But it is backward compatable.

I have a more detailed explanation of the changes if you email me.
Comment 1 jw1233219 2003-02-04 00:25:03 EST
Created attachment 89833 [details]
Patch to make crontab TZ settings affect scheduler
Comment 2 James Baldwin 2003-10-28 01:38:01 EST
You should check the netbsd vixie cron. They have CRON_TZ and CRON_WITHIN both 
implemented as of April 2002. In the interest of compatibility, it would be 
nice to see the same environ names kept.

I have a bunch of production machines which could use this functionality, so 
I'll see if I can't come up with a patch, no promises though, this has been 
backburnered by other issues.

cron(8)
Add support for CRON_TZ and CRON_WITHIN variables in crontab files. [atatat 
20020425]

crontab(5) excerpt on netbsd 1.6
"     In order to provide finer control over when jobs  execute,
       users  can  also set the environment variables CRON_TZ and
       CRON_WITHIN.  The CRON_TZ variable can be set to an alter-
       nate  time  zone  in  order to affect when the job is run.
       Note that this only affects the scheduling of the job, not
       the  time  zone that the job perceives when it is run.  If
       CRON_TZ is defined but empty (CRON_TZ=""), jobs are sched-
       uled with respect to the local time zone.

       The  CRON_WITHIN  variable  should  indicate the number of
       seconds within a job's scheduled time that it should still
       be  run.   On a heavily loaded system, or on a system that
       has just been "woken up", jobs will sometimes start  later
       than  originally  intended,  and  by skipping non-critical
       jobs because of delays, system load can be lightened.   If
       CRON_WITHIN  is  defined but empty (CRON_WITHIN="") or set
       to some non-positive value (0, a  negative  number,  or  a
       non-numeric string), it is treated as if it was unset.
"
Comment 3 Jason Vas Dias 2005-06-03 16:46:13 EDT
Sorry for the delay in processing this enhancement request - 
this one seems to have slipped through the cracks.

I agree this could be a useful feature, and will implement it in the
next version of cron for Rawhide / FC-5 .
Comment 4 Bill Nottingham 2006-08-07 13:32:22 EDT
Red Hat Linux is no longer supported by Red Hat, Inc. If you are still
running Red Hat Linux, you are strongly advised to upgrade to a
current Fedora Core release or Red Hat Enterprise Linux or comparable.
Some information on which option may be right for you is available at
http://www.redhat.com/rhel/migrate/redhatlinux/.

Red Hat apologizes that these issues have not been resolved yet. We do
want to make sure that no important bugs slip through the cracks.
Please check if this issue is still present in a current Fedora Core
release. If so, please change the product and version to match, and
check the box indicating that the requested information has been
provided. Note that any bug still open against Red Hat Linux on will be
closed as 'CANTFIX' on September 30, 2006. Thanks again for your help.
Comment 5 Bill Nottingham 2006-10-18 10:36:02 EDT
Red Hat Linux is no longer supported by Red Hat, Inc. If you are still
running Red Hat Linux, you are strongly advised to upgrade to a
current Fedora Core release or Red Hat Enterprise Linux or comparable.
Some information on which option may be right for you is available at
http://www.redhat.com/rhel/migrate/redhatlinux/.

Closing as CANTFIX.

Note You need to log in before you can comment on or make changes to this bug.