BSD 4_3_Tahoe development
[unix-history] / usr / man / cat1 / at.0
AT(1) UNIX Programmer's Manual AT(1)
N\bNA\bAM\bME\bE
at - execute commands at a later time
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
a\bat\bt [\b[ -\b-c\bc ]\b] [\b[ -\b-s\bs ]\b] [\b[ -\b-m\bm ]\b] time [ day ] [ file ]
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
_\bA_\bt spools away a copy of the named _\bf_\bi_\bl_\be to be used as input
to _\bs_\bh(1) or _\bc_\bs_\bh(1). If the -\b-c\bc flag (for (_\bc_\bs_\bh(1))) or the -\b-s\bs
flag (for (_\bs_\bh(1))) is specified, then that shell will be
used to execute the job; if no shell is specified, the
current environment shell is used. If no file name is
specified, _\ba_\bt prompts for commands from standard input until
a ^D is typed.
If the -\b-m\bm flag is specified, mail will be sent to the user
after the job has been run. If errors occur during execution
of the job, then a copy of the error diagnostics will be
sent to the user. If no errors occur, then a short message
is sent informing the user that no errors occurred.
The format of the spool file is as follows: A four line
header that includes the owner of the job, the name of the
job, the shell used to run the job, and whether mail will be
set after the job is executed. The header is followed by a
_\bc_\bd command to the current directory and a _\bu_\bm_\ba_\bs_\bk command to
set the modes on any files created by the job. Then _\ba_\bt
copies all relevant environment variables to the spool file.
When the script is run, it uses the user and group ID of the
creator of the spool file.
The _\bt_\bi_\bm_\be is 1 to 4 digits, with an optional following `A',
`P', `N' or `M' for AM, PM, noon or midnight. One and two
digit numbers are taken to be hours, three and four digits
to be hours and minutes. If no letters follow the digits, a
24 hour clock time is understood.
The optional _\bd_\ba_\by is either (1) a month name followed by a
day number, or (2) a day of the week; if the word `week'
follows, invocation is moved seven days further off. Names
of months and days may be recognizably truncated. Examples
of legitimate commands are
at 8am jan 24
at -c -m 1530 fr week
at -s -m 1200n week
_\bA_\bt programs are executed by periodic execution of the com-
mand /usr/lib/atrun from _\bc_\br_\bo_\bn(8). The granularity of _\ba_\bt
depends upon the how often atrun is executed.
Printed 7/9/88 March 20, 1986 1
AT(1) UNIX Programmer's Manual AT(1)
Error output is lost unless redirected or the -_\bm flag is
requested, in which case a copy of the errors is sent to the
user via _\bm_\ba_\bi_\bl(1).
F\bFI\bIL\bLE\bES\bS
/usr/spool/at spooling area
/usr/spool/at/yy.ddd.hhhh.* job file
/usr/spool/at/past directory where jobs are executed from
/usr/spool/at/lasttimedone last time atrun was run
/usr/lib/atrun executor (run by cron(8))
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
atq(1), atrm(1), calendar(1), sleep(1), cron(8)
D\bDI\bIA\bAG\bGN\bNO\bOS\bST\bTI\bIC\bCS\bS
Complains about various syntax errors and times out of
range.
B\bBU\bUG\bGS\bS
Due to the granularity of the execution of /_\bu_\bs_\br/_\bl_\bi_\bb/_\ba_\bt_\br_\bu_\bn,
there may be bugs in scheduling things almost exactly 24
hours into the future.
If the system crashes, mail is not sent to the user inform-
ing them that the job was not completed.
Sometimes old spool files are not removed from the directory
/usr/spool/at/past. This is usually due to a system crash,
and requires that they be removed by hand.
Printed 7/9/88 March 20, 1986 2