UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: asChapter 2
Unix Commands
Next: Reference: atq
 

at

at options1 time [date] [+ increment]
at options2 [jobs]

Execute commands entered on standard input at a specified time and optional date. (See also batch and crontab.) End input with EOF. time can be formed either as a numeric hour (with optional minutes and modifiers) or as a keyword. date can be formed either as a month and date, as a day of the week, or as a special keyword. increment is a positive integer followed by a keyword. See the following lists for details.

Options1

-c

Use the C shell to execute the job. Solaris only.

-f file

Execute commands listed in file.

-k

Use the Korn shell to execute the job. Solaris only.

-m

Send mail to user after job is completed.

-q queuename

Schedule the job in queuename. Values for queuename are the lowercase letters a through z. Queue a is the default queue for at jobs. Queue b is the queue for batch jobs. Queue c is the queue for cron jobs. Solaris only.

-s

Use the Bourne shell to execute the job. Solaris only.

-t time

Run the job at time, which is in the same format as allowed by touch. Solaris only.

Options2

-l

Report all jobs that are scheduled for the invoking user or, if jobs are specified, report only for those. See also atq.

-r

Remove specified jobs that were previously scheduled. To remove a job, you must be a privileged user or the owner of the job. Use -l first to see the list of scheduled jobs. See also atrm.

Time

hh:mm [modifiers]

Hours can have one or two digits (a 24-hour clock is assumed by default); optional minutes can be given as one or two digits; the colon can be omitted if the format is h, hh, or hhmm; e.g., valid times are 5, 5:30, 0530, 19:45. If modifier am or pm is added, time is based on a 12-hour clock. If the keyword zulu is added, times correspond to Greenwich Mean Time (UTC).

midnight | noon | now

Use any one of these keywords in place of a numeric time. now must be followed by an increment.

Date

month num[, year]

month is one of the 12 months, spelled out or abbreviated to their first three letters; num is the calendar day of the month; year is the four-digit year. If the given month occurs before the current month, at schedules that month next year.

day

One of the seven days of the week, spelled out or abbreviated to their first three letters.

today | tomorrow

Indicate the current day or the next day. If date is omitted, at schedules today when the specified time occurs later than the current time; otherwise, at schedules tomorrow.

Increment

Supply a numeric increment if you want to specify an execution time or day relative to the current time. The number should precede any of the keywords minute, hour, day, week, month, or year (or their plural forms). The keyword next can be used as a synonym of + 1.

Examples

Note that the first two commands are equivalent:

at 1945 pm December 9
at 7:45pm Dec 9
at 3 am Saturday
at now + 5 hours
at noon next day


Previous: Reference: asUNIX in a Nutshell: System V EditionNext: Reference: atq
Reference: asBook IndexReference: atq

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System