At and batch

20Dec07

While cron is used to schedule regular tasks, the at and batch commands are used to schedule one-off tasks at some point in the future. The difference between at and batch is that at does a task at a given time in the future, while batch does the task when the system is not doing very much, specifically when the “load average” drops below 0.8.

To set up at instructions, type at followed by a time at the command line, as in:

at 13:00

or

at now + 1 hour

To set up batch instructions, simply type:

batch

With both of these, enter your commands, line after line until finished, and then press Ctrl-D while on a blank line. Type the following to get a list of commands set to be completed in the future:

atq

The files /etc/at.allow and /etc/at.deny are used to restrict access to both at and batch.



No Responses Yet to “At and batch”  

  1. No Comments Yet

Leave a Reply