Cron jobs running in UTC timezone on Virtuozzo 4.0 containers
Symptoms
- /etc/crontab showed that cron.daily should be running at 05:08 in the morning, but a grep of the syslogs showed that it was running at 18:08 at night.
# grep daily /etc/crontab
8 5 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
# grep daily /var/log/syslog.0
Mar 25 18:08:01 vps /USR/SBIN/CRON[8110]: (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ))
- The 'date' command showed the right timezone.
# date
Tue Mar 26 16:56:00 NZDT 2013
Cause
/etc/timezone was malformed by having the the local timezone appended, instead of overwritten, in the final stages of customisation by Virtuozzo, when the container was installed.
# cat /etc/timezone
Etc/UTC
Pacific/Auckland
Solution
Removing the bogus "Etc/UTC" line from /etc/timezone fixed the problem.
Comments