Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a Debian Linux server, recent install. It has this cron job:

7 1 * * *       /do/something/important.sh

As I read that, it should run at 1:07am. Instead, it runs at 5:07pm.

So, wrong timezone, right? No...I'm in US/Pacific and:

# ls -l /etc/localtime
lrwxrwxrwx 1 root root 30 Mar  5 20:29 /etc/localtime -> /usr/share/zoneinfo/US/Pacific
# date
Fri Mar  9 16:54:52 PST 2012

That is the right time as I post this.

Now, cron did run for a couple days with the wrong timezone (default was MST). I fixed that by changing /etc/localtime. I also restarted cron (/etc/init.d/cron restart). I've local-gen'd, too.

That job is running at 17:07 Pacific time consistently...something else I missed?

share|improve this question
    
Tough one. Tried reinstating the crontab, yet? i.e. add another cronjob to force it to reload the crontab. –  juwi Mar 10 '12 at 1:38
    
Added a date piped to a tempfile to run at 6pm...checked back and it hadn't fired. –  raindog308 Mar 10 '12 at 4:05
    
Would've been to simple... Does the user maybe still have a different local timezone? –  juwi Mar 10 '12 at 4:16

1 Answer 1

Turns out the answer is: dpkg-reconfigure tzdata

This is a debian-specific thing. I'm not sure of the fine details of what it does, but it fixed the problem.

This command was formerly tzconfig.

share|improve this answer

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.