Start the at utility, specifying the time you want your job executed, and press Return.
$ at [-m] time [date] |
-m |
Sends you mail after the job is completed. |
time |
Hour that you want to schedule the job. Add am or pm if you do not specify the hours according to a 24-hour clock. midnight, noon, and now are acceptable keywords. Minutes are optional. |
date |
First three or more letters of a month, a day of the week, or the keywords today or tomorrow. |
At the at prompt, enter the commands or scripts you want to execute, one per line. You may enter more than one command by pressing Return at the end of each line.
Exit the at utility and save the at job by pressing Control-d.
Your at job is assigned a queue number, which is also its file name. This number is displayed when you exit the at utility.
The following example shows the at job that user jones created to remove her backup files at 7:30 at night. She used the -m option so that she would receive a mail message after her job completed.
$ at -m 1930 at> rm /home/jones/*.backup at> Press Control-d job 897355800.a at Mon Jul 12 19:30:00 1999 |
She received a mail message which confirmed the execution of her at job.
Your "at" job "rm /home/jones/*.backup" completed. |
The following example shows how jones scheduled a large at job for 4:00 Saturday morning. The output of which was directed to big.file.
$ at 4 am Saturday at> sort -r /usr/dict/words > /export/home/jones/big.file |