crontab 1 hour off from current time


 
Thread Tools Search this Thread
Operating Systems AIX crontab 1 hour off from current time
# 1  
Old 03-09-2012
crontab 1 hour off from current time

This is a new one on me. We upgraded a system from AIX 5.3 TL 7 to 6.1 TL 7 yesterday. The app people notified us that their cron jobs weren't running at the right time. So I made a test cron entry and here's what I've found:

Code:
# crontab -l
* * * * * /usr/bin/date > /tmp/test.log 2>&1
# cat /tmp/test.log
Fri Mar  9 08:09:00 CST 2012

# tail -1 /var/adm/cron/log
root   : CMD ( /usr/bin/date > /tmp/test.log 2>&1 ) : PID ( 10944762 ) : Fri Mar  9 09:09:00 2012
Cron Job with pid: 10944762 Successful

So apparently the cron daemon time is an hour ahead of the current time (as displayed by the date command). We've killed the cron daemon multiple times but that hasn't resolved the issue. So things that should run at 5pm (17:00) are really running at 4pm.

Any ideas?

TIA
# 2  
Old 03-09-2012
What's in the TZ line in /etc/environment ?

Also, what you you get for echo $TZ

General consensus is that this is a known fault in AIX 6.1 and requires patches.

Last edited by methyl; 03-09-2012 at 10:58 AM..
# 3  
Old 03-09-2012
Update:
We found the problem is with the TZ variable in /etc/environment.
We still had last years dates in it:
TZ=CST6CDT,M3.2.0/2:00:00,M11.1.0/2:00:00

We changed it to:
TZ=CST6CDT,M3.11.0/2:00:00,M11.4.0/2:00:00

Then restarted cron and now life is good.
This User Gave Thanks to homeyjoe For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Crontab error - bad hour

Hi All, While setting the crontab i am getting the below error, "/tmp/crontab.XXXXwKymEc" 156L, 15621C written crontab: installing new crontab "/tmp/crontab.XXXXwKymEc":74: bad hour Please help. Thanks (2 Replies)
Discussion started by: nag_sathi
2 Replies

2. Shell Programming and Scripting

E-mail based on crontab hour

I have a cron: 0 5,11,17,23 * * * /home/oracle/scripts/sysize.ksh This cron will trigger cat dbsz.txt | mail -s "$TODAY: PROD DB Size" $RECIPIENTS I don't want to get the e-mail notice 4 times a day. Can I have just one e-mail triggered at 11 AM? Please advise. Thank you (3 Replies)
Discussion started by: Daniel Gate
3 Replies

3. Shell Programming and Scripting

How to convert 24 hour time to 12 hour timing?

Hi friends, I want to convert 24 hour timing to 12 hour please help me... my data file looks like this.. 13-Nov-2011 13:27:36 15.32044 72.68502 13-Nov-2011 12:08:31 15.31291 72.69807 16-Nov-2011 01:16:54 15.30844 72.74028 15-Nov-2011 20:09:25 15.35096 ... (13 Replies)
Discussion started by: nex_asp
13 Replies

4. UNIX for Dummies Questions & Answers

Crontab not working with the hour configuration

Hi, When I set the crontab to run every minute, every hour, it works fine. * * * * * env > /tmp/env.output However I want to run it every day at 8:00 AM and it does not run. * 8 * * * env > /tmp/env.output I ran the 'date' command which says it's 8AM PST and also the 'TZ'... (5 Replies)
Discussion started by: samantha13
5 Replies

5. Shell Programming and Scripting

To Run a job every hour without using crontab

Hi, Can anyone help me in finding how to run a specific job every hour without using crontab. Say for example i need to run a command ps -aux in the starting of every hour.. (3 Replies)
Discussion started by: glv
3 Replies

6. UNIX for Dummies Questions & Answers

Execute crontab for every 4 hours and begin from current time

I want to add a crontab entry which should execute for every 4 hours and that 4 hours calculation should begin from the current time. Normally if I set the crontab entry like this, 00 */4 30 05 * root date >>/tmp/cronout The above will execute the date command for every 4 hours like... (7 Replies)
Discussion started by: Ganeshwari
7 Replies

7. Shell Programming and Scripting

Crontab for every minute or every hour

How to set crontab for every minute or every hour (1 Reply)
Discussion started by: kaushik02018
1 Replies

8. Shell Programming and Scripting

Compare file timestamp with current date. Diff must be 1 hour.

Hello, I've created the script below to compare the content of two files with a delay of an hour. After an hour, the lines that exist in both files, will be printed and executed. The script now uses a counter to countdown 50 minutes. But what I would prefer is to check the file timestamp of... (3 Replies)
Discussion started by: taipan
3 Replies

9. Shell Programming and Scripting

Get date and time for past 1 hour from current date

Hi, I need to get the date and time for past 1 hour from the current date. Anyone know how to do so? Thanks (5 Replies)
Discussion started by: spch2o
5 Replies

10. Shell Programming and Scripting

getting hour minus the current time

Can some one help me getting last hour of the current time with date command in a script. (7 Replies)
Discussion started by: shehzad_m
7 Replies
Login or Register to Ask a Question