Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to schedule my tasks in EST but I want the actual task to run under the default system timezone.

Whats the best way of doing this?

share|improve this question

3 Answers 3

Just set in your crontab file variable TZ=Some/Where You can set TZ several times to have separate jobs rund in separate timezones. For example:

TZ=UTC
* 7 * * * root date | mail root
TZ=CEST
* 7 * * * root date | mail root
TZ=PCT
* 7 * * * root date | mail root

at 7:00 UTC (or timezone you have cron daemon runned) three jobs will be runned, but each have its own TZ variable.

share|improve this answer
    
+1 didn't know that - pretty useful. –  Coops Mar 28 '12 at 12:34
    
+1 a very nice tip! –  Janne Pikkarainen Mar 28 '12 at 12:42
    
I want them all to run in the same timezone but at different times! –  DD. Mar 28 '12 at 14:01
    
Agh, cron daemon that itself aware of TZ variable are already there: blogs.oracle.com/chrisg/entry/… –  datacompboy Mar 28 '12 at 15:24
1  
I don't see anything in the question that indicated that the environment was OpenSolaris... Vixie cron specifically says that this doesn't work. –  womble Mar 29 '12 at 8:26
up vote 4 down vote accepted

In CENTOS version of cron just add the line: CRON_TZ=America/New_York

This will run the schedule according to New York time but the task will run in the default time zone.

share|improve this answer

You can run a separate instance of cron with a different TZ environment variable, or just learn to add or subtract a few hours.

share|improve this answer
    
Yeh...its not really that simple with Daylight saving changes which happen at different times in different timezones. I thought the TZ environment variable would mean the process runs in a different TZ? –  DD. Mar 28 '12 at 10:50
    
Yes, and the process that has the different TZ is crond. –  womble Mar 29 '12 at 8:26
    
how can I get the crond service to run in a different TZ? Sorry I'm a unix newbie. –  DD. Mar 29 '12 at 8:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.