|
|
||||
Like Cron (discussed in the IC Tech. Ref. Document: Scheduling Tasks Using Cron), the other tool used for scheduling tasks on Unix systems, At is very useful for scheduling command and script execution.
On most Unix systems, At and Cron work independently but can be used to perform similar tasks. Where Cron is used to perform tasks repeatedly, At is used to run commands or programs just once.
To add a task using At you must type at (when to execute) and hit the enter key. At will then prompt you for the command you wish to have performed. Here is an example dialog:
user@server:~/webshare$ at now + 12 hours [Hit Enter Key] at> cat important.info > important.backup [Hit Cntrl-D] job 1 at Sat Jun 18 09:03:40 2002 user@server:~/webshare$
In addition to the At command, there are a few other tools you can use to manipulate your tasks. For example, to view any pending tasks, type atq at the command prompt and hit enter. Another usefult tool is atrm which you can use to delete tasks. Usage of atrm requires you to call the specific task by number however, so unless you already know the number, you must discover it with atq like so:
user@server:~/webshare$ atq 18 2002-02-13 16:00 a user
And then delete: user@server:~/webshare$ atrm 18
As you saw in our example, the relatively simple syntax supported by At lends itself to quickly setting up tasks. However, this simple syntax belies the ability of At to understand complex time formats. Here's a run-down of the time formats understood by At:/p>
Related Items