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?
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.Visit Stack Exchange
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
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 run) three jobs will run, but each have its own TZ variable.
With the CentOS/RHEL version of cron just add the line:
This will run the schedule according to New York time but the task will run in the default time zone.
export TZ=America/New_York; unix_command; next_cmd_in_sequence
CRON_TZsetting for one table/cron-file - with the CentOS crond. Sep 12, 2020 at 10:02
You can run a separate instance of cron with a different
TZ environment variable, or just learn to add or subtract a few hours.