xref: /netbsd-src/usr.bin/at/at.1 (revision e5548b402ae4c44fb816de42c7bba9581ce23ef5)
1.\" $NetBSD: at.1,v 1.21 2004/07/09 11:29:15 wiz Exp $
2.\" $OpenBSD: at.1,v 1.6 1998/06/05 00:47:46 deraadt Exp $
3.\" $FreeBSD: at.man,v 1.6 1997/02/22 19:54:05 peter Exp $
4.Dd July 9, 2004
5.Dt AT 1
6.Os
7.Sh NAME
8.Nm at ,
9.Nm batch ,
10.Nm atq ,
11.Nm atrm
12.Nd queue, examine or delete jobs for later execution
13.Sh SYNOPSIS
14.Nm at
15.Op Fl bdlmrVv
16.Op Fl f Ar file
17.Op Fl q Ar queue
18.Fl t Ar [[CC]YY]MMDDhhmm[.SS]
19.Nm
20.Op Fl bdlmrVv
21.Op Fl f Ar file
22.Op Fl q Ar queue
23.Ar time
24.Nm
25.Op Fl V
26.Fl c Ar job Op Ar job ...
27.Nm atq
28.Op Fl Vv
29.Op Fl q Ar queue
30.Nm atrm
31.Op Fl V
32.Ar job
33.Op Ar job ...
34.Nm batch
35.Op Fl mVv
36.Op Fl f Ar file
37.Op Fl q Ar queue
38.Op Fl t Ar [[CC]YY]MMDDhhmm[.SS]
39.Nm batch
40.Op Fl mVv
41.Op Fl f Ar file
42.Op Fl q Ar queue
43.Op Ar time
44.Sh DESCRIPTION
45.Nm
46and
47.Nm batch
48read commands from standard input or a specified file which
49are to be executed at a later time, using
50.Xr sh 1 .
51.Bl -tag -width indent
52.It Nm at
53Executes commands at a specified time.
54.It Nm atq
55Lists the user's pending jobs, unless the user is the superuser.
56In that case, everybody's jobs are listed.
57.It Nm atrm
58Deletes jobs.
59.It Nm batch
60Executes commands when system load levels permit.
61In other words, when
62the load average drops below 1.5, or the value specified in the invocation of
63.Xr atrun 8 .
64.El
65.Pp
66.Nm
67allows some moderately complex
68.Ar time
69specifications.
70It accepts times of the form
71.Ar HHMM
72or
73.Ar HH:MM
74to run a job at a specific time of day.
75(If that time is already past, the next day is assumed.)
76You may also specify
77.Sq midnight ,
78.Sq noon ,
79or
80.Sq teatime
81(4pm)
82and you can have a time-of-day suffixed with
83.Sq AM
84or
85.Sq PM
86for running in the morning or the evening.
87You can also say what day the job will be run,
88by giving a date in the form
89.Ar \%month-name day
90with an optional
91.Ar year ,
92or giving a date of the form
93.Ar MMDDYY
94or
95.Ar MM/DD/YY
96or
97.Ar DD.MM.YY .
98The specification of a date must follow the specification of
99the time of day.
100You can also give times like
101.Op Nm now
102.Sq + Ar count \%time-units ,
103where the time-units can be
104.Sq minutes ,
105.Sq hours ,
106.Sq days ,
107or
108.Sq weeks
109and you can tell
110.Nm
111to run the job today by suffixing the time with
112.Sq today
113and to run the job tomorrow by suffixing the time with
114.Sq tomorrow .
115.Pp
116For example, to run a job at 4pm three days from now, you would do
117.Dl at 4pm + 3 days ,
118to run a job at 10:00am on July 31, you would do
119.Dl at 10am Jul 31
120and to run a job at 1am tomorrow, you would do
121.Dl at 1am tomorrow .
122.Pp
123Alternatively the time may be specified in a language-neutral fashion
124by using the
125.Fl t
126options.
127.Pp
128For both
129.Nm
130and
131.Nm batch ,
132commands are read from standard input or the file specified
133with the
134.Fl f
135option and executed.
136The working directory, the environment (except for the variables
137.Ev TERM ,
138.Ev TERMCAP ,
139.Ev DISPLAY
140and
141.Ev _ )
142and the
143.Ar umask
144are retained from the time of invocation.
145An
146.Nm
147or
148.Nm batch
149command invoked from a
150.Xr su 1
151shell will retain the current userid.
152The user will be mailed standard error and standard output from his
153commands, if any.
154Mail will be sent using the command
155.Xr sendmail 8 .
156If
157.Nm
158is executed from a
159.Xr su 1
160shell, the owner of the login shell will receive the mail.
161.Pp
162The superuser may use these commands in any case.
163For other users, permission to use at is determined by the files
164.Pa /var/at/at.allow
165and
166.Pa /var/at/at.deny .
167.Pp
168If the file
169.Pa /var/at/at.allow
170exists, only usernames mentioned in it are allowed to use
171.Nm .
172.Pp
173If
174.Pa /var/at/at.allow
175does not exist,
176.Pa /var/at/at.deny
177is checked, every username not mentioned in it is then allowed
178to use
179.Nm .
180.Pp
181If neither exists, only the superuser is allowed use of
182.Nm .
183.Pp
184An empty
185.Pa /var/at/at.deny
186means that every user is allowed use these commands.
187This is the default configuration.
188.Sh OPTIONS
189.Bl -tag -offset indent -width XqXqueueXX
190.It Fl b
191Is an alias for
192.Nm batch .
193.It Fl c
194Cats the jobs listed on the command line to standard output.
195.It Fl d
196Is an alias for
197.Nm atrm .
198.It Fl f Ar file
199Reads the job from
200.Ar file
201rather than standard input.
202.It Fl l
203Is an alias for
204.Nm atq .
205.It Fl m
206Send mail to the user when the job has completed even if there was no
207output.
208.It Fl q Ar queue
209Uses the specified queue.
210A queue designation consists of a single letter.
211Valid queue designations
212range from
213.Sq a
214to
215.Sq z
216and
217.Sq A
218to
219.Sq Z .
220The
221.Sq c
222queue is the default for
223.Nm
224and the
225.Sq E
226queue for
227.Nm batch .
228Queues with higher letters run with increased niceness.
229If a job is submitted to a queue designated with an uppercase letter, it
230is treated as if it had been submitted to batch at that time.
231If
232.Nm atq
233is given a specific queue, it will only show jobs pending in that queue.
234.It Fl r
235Is an alias for
236.Nm atrm .
237.It Fl t
238For both
239.Nm
240and
241.Nm batch ,
242the time may be specified in a language-neutral format consisting of:
243.Bl -tag -width Ds -compact -offset indent
244.It Ar CC
245The first two digits of the year (the century).
246.It Ar YY
247The second two digits of the year.
248If
249.Ar YY
250is specified, but
251.Ar CC
252is not, a value for
253.Ar YY
254between 69 and 99 results in a
255.Ar CC
256value of 19.
257Otherwise, a
258.Ar CC
259value of 20 is used.
260.It Ar MM
261The month of the year, from 01 to 12.
262.It Ar DD
263The day of the month, from 01 to 31.
264.It Ar hh
265The hour of the day, from 00 to 23.
266.It Ar mm
267The minute of the hour, from 00 to 59.
268.It Ar SS
269The second of the minute, from 00 to 61.
270.El
271.It Fl V
272Prints the version number to standard error.
273.It Fl v
274For
275.Nm atq ,
276shows completed but not yet deleted jobs in the queue.
277Otherwise shows the time the job will be executed.
278.El
279.Sh FILES
280.Bl -tag -width /var/at/.lockfile -compact
281.It Pa /var/at/jobs
282Directory containing job files
283.It Pa /var/at/spool
284Directory containing output spool files
285.It Pa /var/run/utmp
286Login records
287.It Pa /var/at/at.allow
288Allow permission control
289.It Pa /var/at/at.deny
290Deny permission control
291.It Pa /var/at/.lockfile
292Job-creation lock file.
293.El
294.Sh SEE ALSO
295.Xr nice 1 ,
296.Xr sh 1 ,
297.Xr umask 2 ,
298.Xr atrun 8 ,
299.Xr cron 8 ,
300.Xr sendmail 8
301.Sh STANDARDS
302The
303.Nm
304and
305.Nm batch
306utilities conform to
307.St -p1003.2-92 .
308.Sh AUTHORS
309At was mostly written by Thomas Koenig \*[Lt]ig25@rz.uni-karlsruhe.de\*[Gt].
310The time parsing routines are by David Parsons \*[Lt]orc@pell.chi.il.us\*[Gt].
311.Sh BUGS
312If the file
313.Pa /var/run/utmp
314is not available or corrupted, or if the user is not logged on at the
315time
316.Nm
317is invoked, the mail is sent to the userid found
318in the environment variable
319.Ev LOGNAME .
320If that is undefined or empty, the current userid is assumed.
321.Pp
322.Nm
323and
324.Nm batch
325as presently implemented are not suitable when users are competing for
326resources.
327If this is the case for your site, you might want to consider another
328batch system, such as
329.Ic nqs .
330