1848655 Members
8112 Online
104035 Solutions
New Discussion

User's at jobs failing

 
Ronelle van Niekerk
Regular Advisor

User's at jobs failing

Hi guys,

I have a user complaining that his at jobs are failing.

He says he sets his jobs to run at 05:00 and when the at command goes through it says that it will run at 05:01.

The job fails - but of course he has "messed" up whatever logs there might have been because he was trying to copy them ... blah, blah, blah. so I can't see what the error message was.

Why does the at job decide to ru na second after the time he chose? Is there another job running under his name at that time that I can't see?

There are no other at jobs listed and no crons under the user's name.

-Ronell
rm -r /it/managers
9 REPLIES 9
Steven E. Protter
Exalted Contributor

Re: User's at jobs failing

You're really not giving me enough information to help much.

I will suggest this:

Set aside some time and sit down with the user and watch as he/she sets up the jobs.

As far as I know, if the cron daemon is running and the at job is set up right it will run on time.

My best guess is the user has no idea how to set up the jobs. Find him/her a cheat sheet and go through it a few times. These issues are almost user education with our operations staff. They rarely use at and have to be shown how to do it each time.

As far as the jobs themselves, structure them so all of their output goes to a file. Then at least you'll see an error code.

Another thing about at/cron jobs. The user is responsible to set up all of the environment. There is no path, no environment or TERM variable. That has to be set up in a script. A script that works great at the command line can fail for many reasons in cron/at state.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Rob_132
Regular Advisor

Re: User's at jobs failing

Is the user listed in /var/adm/cron/at.allow?

Is the user listed in /var/adm/cron/at.deny?

If only at.deny exists but is empty (s)he should be OK.

If neither file exists, only root can run at jobs, so create the at.allow and add the user.

I don't recall if there is a log file for at, but you can redirect the stderr by adding:

2>/&

...to the end of the command.

Hope this helps.
Rob
Michael Tully
Honored Contributor

Re: User's at jobs failing

It is likely that the job is failing to due to size of the queue. i.e. Are you receiving messages like 'queue max run limit reached'

Have a look at the values in /usr/lib/cron/queuedefs

They should be at least this:

a.4j1n
b.2j2n90w
c.100j1n

a=at jobs
b=batch jobs
c=cron jobs

Could be that cron is overloaded as well. If you make changes to the above file, cron needs to be restarted.
Anyone for a Mutiny ?
Ronelle van Niekerk
Regular Advisor

Re: User's at jobs failing

Steve,

thanks, I'm guessing user error as well. I have seen the comman he is trying to run and he does set up the environment he needs.
I'll get him to redirect the output to a log file (and then leave the damn thing alone) so I can see what is going on.

Rob, the user can run at jobs.

Thanks guys

Ronelle
rm -r /it/managers
Ronelle van Niekerk
Regular Advisor

Re: User's at jobs failing

First, I made a mistke in my original post - the time the jobs run at is 05:00:01, not 05:01.


OK, I've done some more tests and I don't really understand the results:

As root, I set up 2 at jobs to run at 15:10 - they both came up as running at 15:10:00

As the user I set up 2 at jobs to run at 15:12 - one came up as running at 15:12:00 and the other at 15:12:01

As myself I set up 2 at jobs to run at 15:15 - one came up as running at 15:15:00 and the other at 15:15:01

This would indicate to me that if an at job is running at a specific time then another at job, scheduled for the same time, will run a second later. Unless you're root.

So this indicates that the user has a job running at 0500 because when he schedules one at 0500 it runs at 05:00:01. Right?
Only I can't find a job running under the user at that time
rm -r /it/managers
Darren Prior
Honored Contributor

Re: User's at jobs failing

Hi,

The man page for at(1) has the following warning:

"If the execution-time request for a job duplicates the execution time
of a currently scheduled job, the new job time is set to the next
available second."

Is your user specifying the time down to the second, or just to the minute? It could be worth testing.

I'm intrigued why it is so critical that the job runs at the exact time rather than 1 second later, also are your user's timings coming from inside their at job, or the /var/adm/cron/log?

regards,

Darren
Calm down. It's only ones and zeros...
Ronelle van Niekerk
Regular Advisor

Re: User's at jobs failing

Darren,

1) Yes, we've pretty much figured out that the at thinks there is another job scheduled at the same time.

2) The user is specifying only to the minute - we could test it to the second.

3) It is not critical that the job runs at that exact time but it is important to find out why the at jobs think there is another scheduled job running at 05:00:00 when we can't find it.

4) I'm not sure what your last question is asking but after running the at command it tells you when the job is scheduled for and that tell us teh 05:00:01 time
rm -r /it/managers
Ronelle van Niekerk
Regular Advisor

Re: User's at jobs failing

My apologies to everyone.

I just took another look at the cron log file and, I missed it yesterday, another user is scheduling a job at the same time.

Sorry about that.

-Ronelle
rm -r /it/managers
Ronelle van Niekerk
Regular Advisor

Re: User's at jobs failing

My apologies to everyone.

I just took another look at the cron log file and, I missed it yesterday, another user is scheduling a job at the same time.

Sorry about that.

we've also discovered that it is the user's ftp permissions that are causing his job to fail.

-Ronelle
rm -r /it/managers