I'm experiencing a strange problem where occasionally the at command appears to not be running the command I've configured it to run.

For example:

at -t 201510071042

runsomescript does not run at 2015/10/07 10:42am, for some reason. Where can I see why at failed to run the command? I'm looking for some kind of log file for the at process.

Also, I am aware at sends mail. Having said that, I'm not getting an email either when at fails to execute the command.

If I run at -lov immediately after submitting the job, I see it in the queue to be ran at the appropriate time.

Additional info as of 2016-02-17

When the at command fails, mail contains the following "Cron Job Failure" message:

Cron: 0481-072 Cannot change to your home directory. 
  • If you can re-test, check the return code from at ($?) as well as the output of at -l (lower-case ELL) to see if your job made it to the queue. I assume that the contents of at.allow and at.deny are not changing in the interim?
    – Jeff Schaller
    Oct 9 '15 at 16:12
  • I suppose I should have added that at -lov does show the job is in the queue, set for the appropriate time. I have no idea what is in at.allow or at.deny; presumably those are global settings? i.e. I'd need root to see them? Oct 9 '15 at 16:20
  • the at.* files are in /var/adm/cron, which may require root privileges to see. If your jobs are being submitted, though, you're beyond that point. Next thing I wonder about is the shell that it's being run as -- bsh, csh, or ksh.
    – Jeff Schaller
    Oct 9 '15 at 16:31
  • KornShell is the shell. Oct 9 '15 at 16:31
  • 1
    Problem Management Record (ticket / service request) with IBM - to request help with their software.
    – Jeff Schaller
    Nov 2 '15 at 20:54

man at

The at command mails you all output from standard output and standard error for the scheduled commands, unless you redirect that output.

So make sure you can send mail using sendmail, and make sure your script doesn't redirect errors (e.g. to /dev/null).

  • thanks, I should have mentioned in my question that I am aware at sends mail. Having said that, I'm not getting an email either when at fails to execute the command. Oct 8 '15 at 18:03
  • As the user that this at job ran under, did you check his local mailfile via mail command ?
    – doktor5000
    Oct 9 '15 at 14:43
  • yes, mail typically has output from the at command; however not in these particular instances. Oct 9 '15 at 16:33
  • I've added an error message into my question that I was able to see (finally) in mail. Feb 17 '16 at 22:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.