AT(1) — Kubota Pacfic Computer Inc. (User Environment Utilities)
NAME
at, batch − execute commands at a later time
SYNOPSIS
at time [ date ] [ + increment ]
at −r job...
at -l [ job ... ]
batch
DESCRIPTION
at and batch read commands from standard input to be executed at a later time. at allows you to specify when the commands should be executed, while jobs queued with batch will execute when system load level permits. at may be used with the following options:
−r Removes jobs previously scheduled with at.
−l Reports all jobs scheduled for the invoking user.
Standard output and standard error output are mailed to the user unless they are redirected elsewhere. The shell environment variables, current directory, umask, and ulimit are retained when the commands are executed. Open file descriptors, traps, and priority are lost.
Users are permitted to use at if their name appears in the file /usr/lib/cron/at.allow. If that file does not exist, the file /usr/lib/cron/at.deny is checked to determine if the user should be denied access to at. If neither file exists, only root is allowed to submit a job. If at.deny is empty, global usage is permitted. The allow/deny files consist of one user name per line. These files can only be modified by the superuser.
The time may be specified as 1, 2, or 4 digits. One and two digit numbers are taken to be hours, four digits to be hours and minutes. The time may alternately be specified as two numbers separated by a colon, meaning hour:minute. A suffix am or pm may be appended; otherwise a 24-hour clock time is understood. The suffix zulu may be used to indicate GMT. The special names noon, midnight, now, and next are also recognized.
An optional date may be specified as either a month name followed by a day number (and possibly year number preceded by an optional comma) or a day of the week (fully spelled or abbreviated to three characters). Two special “days”, today and tomorrow are recognized. If no date is given, today is assumed if the given hour is greater than the current hour and tomorrow is assumed if it is less. If the given month is less than the current month (and no year is given), next year is assumed.
The optional increment is simply a number suffixed by one of the following: minutes, hours, days, weeks, months, or years. (The singular form is also accepted.)
Thus legitimate commands include:
at 0815am Jan 24
at 8:15am Jan 24
at now + 1 day
at 5 pm Friday
at and batch write the job number and schedule time to standard error.
batch submits a batch job. It is almost equivalent to “at now”, but not quite. For one, it goes into a different queue. For another, “at now” will respond with the error message too late.
at -r removes jobs previously scheduled by at or batch. The job number is the number given to you previously by the at or batch command. You can also get job numbers by typing at -l. You can only remove your own jobs unless you are the super-user.
EXAMPLES
The at and batch commands read from standard input the commands to be executed at a later time. sh(1) provides different ways of specifying standard input. Within your commands, it may be useful to redirect standard output. This sequence can be used at a terminal:
batch
sort filename >outfile
<control-D> (hold down ’control’ and depress ’D’)
This sequence, which demonstrates redirecting standard error to a pipe, is useful in a shell procedure (the sequence of output redirection specifications is significant):
batch <<!
sort filename 2>&1 >outfile | mail loginid
!
To have a job reschedule itself, invoke at from within the shell procedure, by including code similar to the following within the shell file:
echo "sh shellfile" | at 1900 thursday next week
FILES
/usr/lib/cronmain cron directory
/usr/lib/cron/at.allow list of allowed users
/usr/lib/cron/at.deny list of denied users
/usr/lib/cron/queuescheduling information
/usr/spool/cron/atjobs spool area
SEE ALSO
cron(1M), kill(1), mail(1), nice(1), ps(1), sh(1), sort(1), queuedefs(4)
DIAGNOSTICS
Complains about various syntax errors and times out of range.
September 02, 1992