1AT(1) General Commands Manual AT(1)
2
3
4
6 at - execute commands at a later time
7
9 at [ -c ] [ -s ] [ -m ] time [ day ] [ file ]
10
12 At spools away a copy of the named file to be used as input to sh(1) or
13 csh(1). If the -c flag (for (csh(1))) or the -s flag (for (sh(1))) is
14 specified, then that shell will be used to execute the job; if no shell
15 is specified, the current environment shell is used. If no file name
16 is specified, at prompts for commands from standard input until a ^D is
17 typed.
18
19 If the -m flag is specified, mail will be sent to the user after the
20 job has been run. If errors occur during execution of the job, then a
21 copy of the error diagnostics will be sent to the user. If no errors
22 occur, then a short message is sent informing the user that no errors
23 occurred.
24
25 The format of the spool file is as follows: A four line header that
26 includes the owner of the job, the name of the job, the shell used to
27 run the job, and whether mail will be set after the job is executed.
28 The header is followed by a cd command to the current directory and a
29 umask command to set the modes on any files created by the job. Then
30 at copies all relevant environment variables to the spool file. When
31 the script is run, it uses the user and group ID of the creator of the
32 spool file.
33
34 The time is 1 to 4 digits, with an optional following `A', `P', `N' or
35 `M' for AM, PM, noon or midnight. One and two digit numbers are taken
36 to be hours, three and four digits to be hours and minutes. If no let‐
37 ters follow the digits, a 24 hour clock time is understood.
38
39 The optional day is either (1) a month name followed by a day number,
40 or (2) a day of the week; if the word `week' follows, invocation is
41 moved seven days further off. Names of months and days may be recog‐
42 nizably truncated. Examples of legitimate commands are
43
44 at 8am jan 24
45 at -c -m 1530 fr week
46 at -s -m 1200n week
47
48 At programs are executed by periodic execution of the command
49 /usr/libexec/atrun from cron(8). The granularity of at depends upon
50 the how often atrun is executed.
51
52 Error output is lost unless redirected or the -m flag is requested, in
53 which case a copy of the errors is sent to the user via mail(1).
54
56 /usr/spool/at spooling area
57 /usr/spool/at/yy.ddd.hhhh.* job file
58 /usr/spool/at/past directory where jobs are executed from
59 /usr/spool/at/lasttimedone last time atrun was run
60 /usr/libexec/atrun executor (run by cron(8))
61
63 atq(1), atrm(1), calendar(1), sleep(1), cron(8)
64
66 Complains about various syntax errors and times out of range.
67
69 Due to the granularity of the execution of /usr/libexec/atrun, there
70 may be bugs in scheduling things almost exactly 24 hours into the
71 future.
72
73 If the system crashes, mail is not sent to the user informing them that
74 the job was not completed.
75
76 Sometimes old spool files are not removed from the directory
77 /usr/spool/at/past. This is usually due to a system crash, and requires
78 that they be removed by hand.
79
80
81
824th Berkeley Distribution October 21, 1996 AT(1)