AT job scheduled exactly 2 hours late


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers AT job scheduled exactly 2 hours late
# 1  
Old 07-25-2005
AT job scheduled exactly 2 hours late

This occurs on an i386 box running Unix System V/386 Release 4.2 Ver 1.1.2.

I have an 'at' scheduling anomaly whose behavior I am trying to understand. On one particular system, when an 'at' job is submitted, the time the job is actually scheduled to run is exactly 2 hours later than what the command stipulated. I append the output that illustrates the problem:

-----------------------------
btd33m01!root[9] date
Fri May 13 09:19:42 EDT 2005
btd33m01!root[10] at 09:21
/test.sh

UX:at: WARNING: Commands will be executed using /usr/bin/sh
UX:at: INFO: Job 1115997660.a.0 at Fri May 13 11:21:00 2005
btd33m01!root[11]
-----------------------------

So, at 09:19:42 I submit the 'at' job to run at 09:21, and the system replies "OK, I'll run it at 11:21." The "consistently off by exactly 2 hours" symptom suggests to me some kind of timezone cause.
However, the TZ env var looks the same as the other related systems, none of which display this problem:
TZ=':/usr/lib/locale/TZ/US/Eastern'

Does anyone have any explanation or a suggestion on what else to look at?
Thanks!

Last edited by bohunk24; 07-26-2005 at 02:33 PM..
# 2  
Old 07-25-2005
Re: at job schedule anomaly - cron jobs are OK

I forgot to add ...

Entries in the crontab on that system, run at the correct time.
This symptom affects only jobs submitted using 'at'.
# 3  
Old 07-26-2005
That is a strange one. Here is a totally wild guess. Is it possible the user you are logged into when doing the at command has the TZ variable being set differently in their login scripts (.login, .profile, whatever) than what the default TZ for the system is?

I doubt that would work but I can't think of any other way that symptom would be happening. Try touching a file then look at the timestamp to see if that is two hours off also maybe.

Good luck.
# 4  
Old 07-26-2005
Thanks for the suggestion, but no that can't be the case.
This occurs when logged in as root, which is always the case for us on these systems, i.e. we never log in as anything else.
# 5  
Old 07-26-2005
Use this command to launch an environmentless subshell:
env - /usr/bin/ksh
and try the at command again. Is it still 2 hours off?
# 6  
Old 07-26-2005
Hi, Perderabo -
Your suggestion was helpful! In the environmentless ksh, the at command was scheduled at the proper time. Of course, with no environment vars defined, it used GMT. When I then added only this one env var definition:
export TZ=:/usr/lib/locale/TZ/US/Eastern
the 2-hours-off symptom began to occur in this "stripped down" shell.

I compared this Eastern file to one on a related system (that schedules OK) and the files are identical. I even copied it over from a "good" system to try it, but with no effect. I also tried other TZ files, Central, etc. and, while the time changed, depending on the TZ value, the 2-hours-off symptom persisted.

One detail about TZ I don't understand.
When I assigned this value to TZ (i.e. without a leading colon):
export TZ=/usr/lib/locale/TZ/US/Eastern
the variable seems to be ignored. The at schedule used GMT, as if TZ were not set.
However, if it is set this way:
export TZ=:/usr/lib/locale/TZ/US/Eastern
the symptom always occurs.

So, your suggestion has helped shed a little light on this.
It is somehow connected to the TZ setting, but it's not clear exactly where the problem is. Do you have any follow-up ideas? Thanks!
# 7  
Old 07-26-2005
I doubt that your TZ variable is set correctly. That "related system"...is it running the same OS? And the TZ variable really has that odd value? On the malfunctioning system, try:
/usr/sbin/zdump -v -c 2007 $TZ | tail
and post the results. And try setting
TZ=US/Eastern
and see if the at job still is 2 hours off.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Cron job scheduled is running once, but reports are generating twice

Team, Hope you all are doing fine I have one admin server which is being used dedicately to run cron jobs on hourly basis, fetching the details from Database which is in a different server.These cronjob are run on every hourly/5 minutes basis depending as per end user requirement.The script... (12 Replies)
Discussion started by: whizkidash
12 Replies

2. Shell Programming and Scripting

Scheduled job not running automatically in crontab

i have a job scheduled in crontab. The problem is, it is not running automatically as per the time scheduled. But runs when executed manually. What would be the problem? Help me with this please. (6 Replies)
Discussion started by: Santhosh CJ
6 Replies

3. Shell Programming and Scripting

run unix script as scheduled job

Hi, I want my unix script to run as a scheduled job such that the script is invoked once every 15 minutes. Is there any way to achieve this other than running the script as a cron job? (2 Replies)
Discussion started by: vignesh53
2 Replies

4. UNIX for Dummies Questions & Answers

at -l doesnt give details of the scheduled job. How to get the details?

I have scheduled couple of shell scripts to run using 'at' command. The o/p of at -l is: $ at -l 1320904800.a Thu Nov 10 01:00:00 2011 1320894000.a Wed Nov 9 22:00:00 2011 1320876000.a Wed Nov 9 17:00:00 2011 $ uname -a SunOS dc2prcrptetl2 5.9 Generic_122300-54 sun4u sparc... (2 Replies)
Discussion started by: superparticle
2 Replies

5. Programming

Oracle Scheduled job not running as per schedule.

Hi, Though this is a unix forum mainly, am posting this oracle query here hoping to get a resolution. I have set up two scheduled jobs in oracle 11g for executiong a procedure in specific time intervals. One as Hourly and other as minutely. But the scheduled jobs are not running as per... (2 Replies)
Discussion started by: suresh_kb211
2 Replies

6. Shell Programming and Scripting

Cron job for every five minutes and between hours

Hi I need to run a script every five minutes and it should run between 07-15 hours all days. How i can achieve this... i tried like this */5 07-15 * * * /scripts/CreateFtpData.sh It throws an error... (1 Reply)
Discussion started by: aemunathan
1 Replies

7. UNIX for Dummies Questions & Answers

Scheduled job

I have a lot of jobs scheduled using at command. at -l gives only the job names and time ... how do i know which script is associated with which jobid. Thanks. (1 Reply)
Discussion started by: blackeyed
1 Replies

8. UNIX for Dummies Questions & Answers

problem when the script is scheduled to run as cron job

Hello, I have problem in executing a shell script. When the shell script is executed at the shell prompt the script works successfully but when the same script is run as a cron job it fails to execute the files called within the shell script. I have scheduled the job in my crontab file as ... (6 Replies)
Discussion started by: forumthreads
6 Replies

9. Shell Programming and Scripting

Conditional File Movement script scheduled using CRON job

Hi All, i am trying to automate a process and have to create a unix script like wise. I have a scenario in which i need to automate a file movement. Below are the steps i need to automate. 1. Check whether a file (Not Fixed name-Pattern search of file say 'E*.dat') is present in a... (2 Replies)
Discussion started by: imu
2 Replies
Login or Register to Ask a Question