at(1) CLIX at(1)
NAME
at, batch - Reads commands for later execution
SYNOPSIS
at [-q queue] time [date] [+increment]
at -r job ...
at -l [job ... ]
batch
DESCRIPTION
The at and batch commands read commands from stdin to be executed at a
later time. The at command allows you to specify when the commands should
be executed, while jobs queued with batch will execute when system load
level permits. The at command may be used with the following flags:
-r Removes jobs previously scheduled with at.
-l Reports all jobs scheduled for the invoking user.
-q queue Specifies queue to which a job will be sent. Valid options are
a-z. The default is a.
Any output to stdout and stderr is 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 username 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
2/94 - Intergraph Corporation 1
at(1) CLIX at(1)
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
The at and batch commands write the job number and schedule time to
stderr.
The batch command 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. The
designated queue for batch is b.
The at -r command 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 superuser.
EXAMPLES
The at and batch commands read from stdin the commands to be executed at a
later time. The sh command provides different ways of specifying stdin.
1. To redirect stdout at the terminal command line:
batch
sort filename >outfile<Ctrl-D>
2. To redirect stderr 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
!
3. To have a job reschedule itself, invoke at from within the shell
procedure, by including code similar to the following within the shell
2 Intergraph Corporation - 2/94
at(1) CLIX at(1)
file:
echo "sh shellfile"|at 1900 thursday next week
FILES
/usr/lib/cron Main cron directory
/usr/lib/cron/at.allow List of allowed users
/usr/lib/cron/at.deny List of denied users
/usr/lib/cron/queue Scheduling information
/usr/spool/cron/atjobs Spool area
DIAGNOSTICS
Complains about various syntax errors and times out of range.
RELATED INFORMATION
Commands: kill(1), mail(1), nice(1), ps(1), sh(1), sort(1), cron(8)
Files: queuedefs(4)
2/94 - Intergraph Corporation 3