at is a UNIX command which allows a script to be executed once at a specified time and/or date. This is an alternative to running one-off jobs in the cron. In using it, you do not need to remember to remove the cron line once it is no longer required.
The following syntax used at the UNIX command prompt, allows a job to be scheduled:
at {time-to-run) {date-to-run)
For example entering
at 0800 Feb 23
will produce the at> prompt, from where you should enter the command to be run at this time. Note that:
If no date is specified, today is assumed.
If no date is specified and the time is less than now, tomorrow is assumed.
If no month is specified, the current month is assumed.
If a month earlier than the current month is given, next year is assumed.
Using CTRL-D will exit the prompt and offer you a job reference number. When an at job has run, a message will be written to the UNIX mailbox of the account name running the job.
Your queued at jobs can be viewed using the atq command at the UNIX prompt. This will reveal the job reference number, owners and the date and time that jobs are due to run.
To cancel a job use the command:
atrm {job reference}
at the UNIX prompt. You must have appropriate permissions to do this. The command:
atrm –a
will cancel all jobs for your current UNIX account.
Note
When using these commands, the root user account has the privilege to view or cancel all at jobs.