at job significantly delayed after resume from suspend?

Asked by ara

Hi.
I schedule an at job and then suspend (to RAM). I resume from suspend, as much as 30 seconds before the at job is scheduled to run. I can even run `at -l' and see the job. I ran `ps -e' and saw atd running. However, the job doesn't run at the scheduled time, but instead, it runs almost an hour (maybe 40 or 50 minutes) after the scheduled time.

Another instance of this problem occurred when I resumed from suspend before the scheduled time of a job, the job didn't run as scheduled, and I suspended the system again (maybe 10 or 20 minutes after the job was scheduled to run). After many hours, I resumed from suspend, and according to the output of `at -l', the job was still scheduled for the same time. After about 20 minutes, the job ran.

Is this a bug? Is this a valid use case for `at'? Does anyone know if `cron' would have the same issues? Perhaps I can try to use `cron' instead.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu at Edit question
Assignee:
No assignee Edit question
Solved by:
ara
Solved:
Last query:
Last reply:
Revision history for this message
mycae (mycae) said :
#1

If you are using STR, you may want to try anacron, instead of at or cron...

Revision history for this message
ara (aralibhai) said :
#2

Thanks for your suggestion. I looked into `anacron', but it doesn't allow me to schedule jobs at specific times like `at' or `cron'. It is more for periodic jobs.

Perhaps the problem with `at' is that it checks every hour if it needs to run a job within the next hour or something. That's just a guess, based on my issue.

I looked more into `cron' and the manual said that it "wakes up every minute, examining all stored crontabs", which seemed perfect for me. So I started using `cron' instead of `at', and it works perfectly.