Initial import from FreeBSD RELENG_4:
[games.git] / usr.bin / at / at.man
1 .\" $FreeBSD: src/usr.bin/at/at.man,v 1.13.2.10 2003/05/03 21:55:26 keramida Exp $
2 .Dd April 12, 1995
3 .Dt "AT" 1
4 .Os
5 .Sh NAME
6 .Nm at ,
7 .Nm batch ,
8 .Nm atq ,
9 .Nm atrm
10 .Nd queue, examine or delete jobs for later execution
11 .Sh SYNOPSIS
12 .Nm at
13 .Op Fl V
14 .Op Fl q Ar queue
15 .Op Fl f Ar file
16 .Op Fl mldbv
17 .Ar time
18 .Nm at
19 .Op Fl V
20 .Fl c Ar job Op Ar job ...
21 .Pp
22 .Nm atq
23 .Op Fl V
24 .Op Fl q Ar queue
25 .Op Fl v
26 .Pp
27 .Nm atrm
28 .Op Fl V
29 .Ar job
30 .Op Ar job ...
31 .Pp
32 .Nm batch
33 .Op Fl V
34 .Op Fl q Ar queue
35 .Op Fl f Ar file
36 .Op Fl mv
37 .Op Ar time
38 .Sh DESCRIPTION
39 .Nm \&At
40 and
41 .Nm batch
42 read commands from standard input or a specified file which are to
43 be executed at a later time, using
44 .Xr sh 1 .
45 .Bl -tag -width indent
46 .It Nm at
47 executes commands at a specified time;
48 .It Nm atq
49 lists the user's pending jobs, unless the user is the superuser; in that
50 case, everybody's jobs are listed;
51 .It Nm atrm
52 deletes jobs;
53 .It Nm batch
54 executes commands when system load levels permit; in other words, when the load average
55 drops below _LOADAVG_MX, or the value specified in the invocation of
56 .Nm atrun .
57 .El
58 .Pp
59 .Nm \&At
60 allows some moderately complex
61 .Ar time
62 specifications.
63 It accepts times of the form
64 .Ar HHMM
65 or
66 .Ar HH:MM
67 to run a job at a specific time of day.
68 (If that time is already past, the next day is assumed.)
69 As an alternative, the following keywords may be specified:
70 .Em midnight ,
71 .Em noon ,
72 or
73 .Em teatime
74 (4pm)
75 and time-of-day may be suffixed with
76 .Em AM
77 or
78 .Em PM
79 for running in the morning or the evening.
80 The day on which the job is to be run may also be specified
81 by giving a date in the form
82 .Ar \%month-name day
83 with an optional
84 .Ar year ,
85 or giving a date of the forms
86 .Ar DD.MM.YYYY ,
87 .Ar DD.MM.YY ,
88 .Ar MM/DD/YYYY ,
89 .Ar MM/DD/YY ,
90 .Ar MMDDYYYY , or
91 .Ar MMDDYY .
92 The specification of a date must follow the specification of
93 the time of day.
94 Time can also be specified as:
95 .Op Em now
96 .Em + Ar count \%time-units ,
97 where the time-units can be
98 .Em minutes ,
99 .Em hours ,
100 .Em days ,
101 .Em weeks ,
102 .Em months
103 or
104 .Em years
105 and you can tell
106 .Nm
107 to run the job today by suffixing the time with
108 .Em today
109 and to run the job tomorrow by suffixing the time with
110 .Em tomorrow .
111 .Pp
112 For example, to run a job at 4pm three days from now, you would do
113 .Nm at Ar 4pm + 3 days ,
114 to run a job at 10:00am on July 31, you would do
115 .Nm at Ar 10am Jul 31
116 and to run a job at 1am tomorrow, you would do
117 .Nm at Ar 1am tomorrow .
118 .Pp
119 For both
120 .Nm
121 and
122 .Nm batch ,
123 commands are read from standard input or the file specified
124 with the
125 .Fl f
126 option and executed.
127 The working directory, the environment (except for the variables
128 .Ev TERM ,
129 .Ev TERMCAP ,
130 .Ev DISPLAY
131 and
132 .Em _ )
133 and the
134 .Ar umask
135 are retained from the time of invocation.
136 An
137 .Nm
138 or
139 .Nm batch
140 command invoked from a
141 .Xr su 1
142 shell will retain the current userid.
143 The user will be mailed standard error and standard output from his
144 commands, if any.
145 Mail will be sent using the command
146 .Xr sendmail 8 .
147 If
148 .Nm
149 is executed from a
150 .Xr su 1
151 shell, the owner of the login shell will receive the mail.
152 .Pp
153 The superuser may use these commands in any case.
154 For other users, permission to use
155 .Nm
156 is determined by the files
157 .Pa _PERM_PATH/at.allow
158 and
159 .Pa _PERM_PATH/at.deny .
160 .Pp
161 If the file
162 .Pa _PERM_PATH/at.allow
163 exists, only usernames mentioned in it are allowed to use
164 .Nm .
165 In these two files, a user is considered to be listed only if the user
166 name has no blank or other characters before it on its line and a
167 newline character immediately after the name, even at the end of
168 the file.
169 Other lines are ignored and may be used for comments.
170 .Pp
171 If
172 .Pa _PERM_PATH/at.allow
173 does not exist,
174 .Pa _PERM_PATH/at.deny
175 is checked, every username not mentioned in it is then allowed
176 to use
177 .Nm Ns .
178 .Pp
179 If neither exists, only the superuser is allowed use of
180 .Nm Ns .
181 This is the default configuration.
182 .Sh OPTIONS
183 .Bl -tag -width indent
184 .It Fl V
185 Print the version number to standard error.
186 .It Fl q Ar queue
187 Use the specified queue.
188 A queue designation consists of a single letter; valid queue designations
189 range from
190 .Ar a
191 to
192 .Ar z
193 and
194 .Ar A
195 to
196 .Ar Z .
197 The
198 .Ar _DEFAULT_AT_QUEUE
199 queue is the default for
200 .Nm
201 and the
202 .Ar _DEFAULT_BATCH_QUEUE
203 queue for
204 .Nm batch .
205 Queues with higher letters run with increased niceness.
206 If a job is submitted to a queue designated with an uppercase letter, it
207 is treated as if it had been submitted to batch at that time.
208 If
209 .Nm atq
210 is given a specific queue, it will only show jobs pending in that queue.
211 .It Fl m
212 Send mail to the user when the job has completed even if there was no
213 output.
214 .It Fl f Ar file
215 Read the job from
216 .Ar file
217 rather than standard input.
218 .It Fl l
219 Is an alias for
220 .Nm atq .
221 .It Fl d
222 Is an alias for
223 .Nm atrm .
224 .It Fl b
225 Is an alias for
226 .Nm batch .
227 .It Fl v
228 For
229 .Nm atq ,
230 shows completed but not yet deleted jobs in the queue; otherwise
231 shows the time the job will be executed.
232 .It Fl c
233 Cat the jobs listed on the command line to standard output.
234 .El
235 .Sh FILES
236 .Bl -tag -width _ATJOB_DIR/_LOCKFILE -compact
237 .It Pa _ATJOB_DIR
238 directory containing job files
239 .It Pa _ATSPOOL_DIR
240 directory containing output spool files
241 .It Pa /var/run/utmp
242 login records
243 .It Pa _PERM_PATH/at.allow
244 allow permission control
245 .It Pa _PERM_PATH/at.deny
246 deny permission control
247 .It Pa _ATJOB_DIR/_LOCKFILE
248 job-creation lock file
249 .El
250 .Sh SEE ALSO
251 .Xr nice 1 ,
252 .Xr sh 1 ,
253 .Xr umask 2 ,
254 .Xr atrun 8 ,
255 .Xr cron 8 ,
256 .Xr sendmail 8
257 .Sh BUGS
258 If the file
259 .Pa /var/run/utmp
260 is not available or corrupted, or if the user is not logged on at the
261 time
262 .Nm
263 is invoked, the mail is sent to the userid found
264 in the environment variable
265 .Ev LOGNAME .
266 If that is undefined or empty, the current userid is assumed.
267 .Pp
268 .Nm \&At
269 and
270 .Nm batch
271 as presently implemented are not suitable when users are competing for
272 resources.
273 If this is the case for your site, you might want to consider another
274 batch system, such as
275 .Em nqs .
276 .Sh AUTHORS
277 At was mostly written by
278 .An Thomas Koenig Aq ig25@rz.uni-karlsruhe.de .
279 The time parsing routines are by
280 .An David Parsons Aq orc@pell.chi.il.us .