AIX - 'at' command

I am working on AIX 5.2 platform and working with AIX command 'at' . May
I am getting a weird problem . I have a script which is scheduled to run
everyday.It uses 'at' command to call one java program.
Most of the times 'at' command works fine without any issue but sometimes 'at' command doesn't run and gives back following error.

0481-103 Cannot open a file in the /var/spool/cron/atjobs directory.

I looked for this on google , according to which this error occurs when
atjobs diectory doesn't exist.Although I didn't get the reason why sometimes atjobs is missing but while trying to reproduce the same thing on my development environment havin AIX 5.2 . I renamed atjobs folder to atjobs_bak and when I was able to reproduce the error I again renamed it back from atjobs_bak to atjobs.

Now what is happening what ever I am running with 'at' command is getting queued up in /var/spool/cron/atjobs directory.
And not running at all on the schduled time.

Please help me out if anyone is aware of this kind of scenario.

If you want the job to run everyday, why don't you use cron instead of at? You can submit the job once rather than having to submit it daily.

Yeah I understand that but it is not running on a particular time everyday . It is dependent on a process which has to run before it and it has to start and stop the process everyday.Thats a requirement.

---------- Post updated at 03:08 PM ---------- Previous update was at 02:52 PM ----------

It is like everyday application server is started and stopped.There is no particular time , it is usually between 2:25 AM to 2:40 AM.Along with this 'at' job starts and stops.

---------- Post updated 12-09-09 at 07:51 AM ---------- Previous update was 12-08-09 at 03:08 PM ----------

I need to now this urgently...can anybody help me ?

Why not implement it though via cron that way, that the cron script checks if the previous job has set a flag in the filesystem like an empty file and if it finds it, it will fire off the main script that you wanted to implement with at.

hmm... actually script which calls at job has lot of logic before calling the at jobs.I have to change whole script . I am looking at the minimum changes to be done with the sctript. But what is a problem using 'at' . Is there some known issue with 'at' command which I am not aware of ?

Generally there is no problem with at - we just wanted to name alternatives to it since you posted that it sometimes doesn't work.

Which user is running the at job? Is it root or an application user?

Maybe the file permissions of a file in there doesn't allow an action to occur? Is the filesystem full?

I know there was a problem at one point with the at command not deleting the at job once it had been run.

Regarding at command queuing up the job and not running the job , I have killed the cron daemon by using kill <process-id-cron-daemon (/usr/sbin/cron) > and jobs started running so that problem is solved.

But at jobs sometimes doesn't run , that problem still persist.Application user is running at jobs. It does't seem to be file permission problem as it runs the at jobs sometimes with the same userid and sometimes it doesnt run and throws an error 0481-103 Cannot open a file in the /var/spool/cron/atjobs directory.

So that leaves file system issues as possible causes. Have you checked the availability of free disk space and/or inodes? The directory in question will (by default) be served by LV "hd9var".

I hope this helps.

bakunin

Hunch based on googling the error message. The error message is normally associated with issuing "crontab -l" when there is no crontab for that user.

Listing the queued "at" jobs is of course "at -l".

Assuming that the error message did not come from issuing "crontab -l" instead of "at -l", and if there is definitely no crontab for the user of the "at" jobs, try creating a crontab for that user containing only comment lines.

ok does that mean when we are out of disk space on hd9var , this issue may occur ? this sounds logical although..

---------- Post updated at 09:12 AM ---------- Previous update was at 09:10 AM ----------

I already have some crontab entries...this is not an empty file...

---------- Post updated at 09:13 AM ---------- Previous update was at 09:12 AM ----------

I would like to thank you all....Although i didnt get to the exact issue yet...but each one of you helped me to get onto the next step...I hope i solve it soon and post it back ....