3

Say I schedule a job to be run in a few days using at. And say in a few hours I think, "you know, I want that command to run now". Is there a simple way to just run that scheduled job now, instead of later?

I'm aware I could simply atrm it and run the command by hand, but our commands are automated and quite complex. It would be nice if there was some simple way to run the jobs now instead of later.

2 Answers2

3

You can use at -c and the job number to get the contents of the script and either pipe this to your shell or resubmit it then remove the job with atrm.

meuh
  • 51,383
1

If you have root access, you could use atq to identify the job, find the corresponding job script in /var/spool/cron/atjobs/ directory (or wherever your version of the at tools puts it) and run it manually as the appropriate user, then remove the scheduled job.

telcoM
  • 96,466