5

I would like to use UTC for the scheduling times in a crontab for a single user, regardless of the current time zone of the server. How do I do this on Debian Etch?

1

2 Answers 2

4

you can set the variable TZ in /etc/default/cron. but this is the timezone for all crontabs.

another alternative is using fcron. the documentation shows an option to set the timezone in each crontab.

1

Some cron installations use CRON_TZ to set the per-user interpretation of the crontab times.

Here's part of man 5 crontab on Centos 7:

The CRON_TZ variable specifies the time zone specific for the cron table. The user should enter a time according to the specified time zone into the table. The time used for writing into a log file is taken from the local time zone, where the daemon is running.

Default Debian uses a patched vixiecron, (per https://wiki.debian.org/cron) and does not support per-user time zone functionality. If you set a variable in the crontab, it passes to the child jobs, but does not affect the TZ of the parent cron job. Debian has a 'cronie' package in experimental that supports the CRON_TZ functionality.

1
  • 1
    Haha. I love how Debian puts cronie in "experimental" when the rest of the Linux world has been using it for 10 years or more. Aug 16, 2020 at 15:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .