]> git.saurik.com Git - apple/system_cmds.git/blame_incremental - at.tproj/at.1
system_cmds-880.100.5.tar.gz
[apple/system_cmds.git] / at.tproj / at.1
... / ...
CommitLineData
1.\" $FreeBSD: src/usr.bin/at/at.man,v 1.34 2003/03/26 02:38:18 keramida Exp $
2.Dd January 13, 2002
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 q Ar queue
14.Op Fl f Ar file
15.Op Fl mldbv
16.Ar time
17.Nm at
18.Op Fl q Ar queue
19.Op Fl f Ar file
20.Op Fl mldbv
21.Fl t
22.Sm off
23.Op Oo Ar CC Oc Ar YY
24.Ar MM DD hh mm Op . Ar SS
25.Sm on
26.Nm at
27.Fl c Ar job Op Ar job ...
28.Nm at
29.Fl l Op Ar job ...
30.Nm at
31.Fl l
32.Fl q Ar queue
33.Nm at
34.Fl r Ar job Op Ar job ...
35.Pp
36.Nm atq
37.Op Fl q Ar queue
38.Op Fl v
39.Pp
40.Nm atrm
41.Ar job
42.Op Ar job ...
43.Pp
44.Nm batch
45.Op Fl q Ar queue
46.Op Fl f Ar file
47.Op Fl mv
48.Op Ar time
49.Sh DESCRIPTION
50The
51.Nm at
52and
53.Nm batch
54utilities
55read commands from standard input or a specified file.
56The commands are executed at a later time, using
57.Xr sh 1 .
58.Bl -tag -width indent
59.It Nm at
60executes commands at a specified time;
61.It Nm atq
62lists the user's pending jobs, unless the user is the superuser; in that
63case, everybody's jobs are listed;
64.It Nm atrm
65deletes jobs;
66.It Nm batch
67executes commands when system load levels permit; in other words, when the load average
68drops below _LOADAVG_MX (1.5), or the value specified in the invocation of
69.Nm atrun .
70.El
71.Pp
72The
73.Nm at
74utility allows some moderately complex
75.Ar time
76specifications.
77It accepts times of the form
78.Ar HHMM
79or
80.Ar HH:MM
81to run a job at a specific time of day.
82(If that time is already past, the next day is assumed.)
83As an alternative, the following keywords may be specified:
84.Em midnight ,
85.Em noon ,
86or
87.Em teatime
88(4pm)
89and time-of-day may be suffixed with
90.Em AM
91or
92.Em PM
93for running in the morning or the evening.
94The day on which the job is to be run may also be specified
95by giving a date in the form
96.Ar \%month-name day
97with an optional
98.Ar year ,
99or giving a date of the forms
100.Ar DD.MM.YYYY ,
101.Ar DD.MM.YY ,
102.Ar MM/DD/YYYY ,
103.Ar MM/DD/YY ,
104.Ar MMDDYYYY , or
105.Ar MMDDYY .
106The specification of a date must follow the specification of
107the time of day.
108Time can also be specified as:
109.Op Em now
110.Em + Ar count \%time-units ,
111where the time-units can be
112.Em minutes ,
113.Em hours ,
114.Em days ,
115.Em weeks ,
116.Em months
117or
118.Em years
119and
120.Nm at
121may be told to run the job today by suffixing the time with
122.Em today
123and to run the job tomorrow by suffixing the time with
124.Em tomorrow .
125The shortcut
126.Em next
127can be used instead of
128.Em + 1 .
129.Pp
130For example, to run a job at 4pm three days from now, use
131.Nm at Ar 4pm + 3 days ,
132to run a job at 10:00am on July 31, use
133.Nm at Ar 10am Jul 31
134and to run a job at 1am tomorrow, use
135.Nm at Ar 1am tomorrow .
136.Pp
137The
138.Nm at
139utility also supports the
140.Tn POSIX
141time format (see
142.Fl t
143option).
144.Pp
145For both
146.Nm at
147and
148.Nm batch ,
149commands are read from standard input or the file specified
150with the
151.Fl f
152option.
153The working directory, the environment (except for the variables
154.Ev TERM ,
155.Ev TERMCAP ,
156.Ev DISPLAY
157and
158.Em _ ) ,
159and the
160.Ar umask
161are retained from the time of invocation.
162An
163.Nm at
164or
165.Nm batch
166command invoked from a
167.Xr su 1
168shell will retain the current userid.
169The user will be mailed standard error and standard output from his
170commands, if any.
171Mail will be sent using the command
172.Xr sendmail 8 .
173If
174.Nm at
175is executed from a
176.Xr su 1
177shell, the owner of the login shell will receive the mail.
178.Pp
179The superuser may use these commands in any case.
180For other users, permission to use
181.Nm at
182is determined by the files
183.Pa _PERM_PATH/at.allow
184and
185.Pa _PERM_PATH/at.deny .
186.Pp
187If the file
188.Pa _PERM_PATH/at.allow
189exists, only usernames mentioned in it are allowed to use
190.Nm at .
191In these two files,
192a user is considered to be listed
193only if the user name has no blank or other characters
194before it on its line and a newline character immediately after the name,
195even at the end of the file.
196Other lines are ignored and may be used for comments.
197.Pp
198If
199.Pa _PERM_PATH/at.allow
200does not exist,
201.Pa _PERM_PATH/at.deny
202is checked, every username not mentioned in it is then allowed
203to use
204.Nm at .
205.Pp
206If neither exists, only the superuser is allowed use of
207.Nm at .
208.Sh IMPLEMENTATION NOTES
209Note that
210.Nm at
211is implemented through the
212.Xr launchd 8
213daemon periodically invoking
214.Xr atrun 8 ,
215which is disabled by default.
216See
217.Xr atrun 8
218for information about enabling
219.Nm atrun .
220.Sh OPTIONS
221.Bl -tag -width indent
222.It Fl b
223Is an alias for
224.Nm batch .
225.It Fl c
226Cat the jobs listed on the command line to standard output.
227.It Fl d
228Is an alias for
229.Nm atrm
230(this option is deprecated; use
231.Fl r
232instead).
233.It Fl f Ar file
234Read the job from
235.Ar file
236rather than standard input.
237.It Fl l
238With no arguments, list all jobs for the invoking user.
239If one or more
240job numbers are given, list only those jobs.
241.It Fl m
242Send mail to the user when the job has completed even if there was no
243output.
244.It Fl q Ar queue
245Use the specified queue.
246A queue designation consists of a single letter; valid queue designations
247range from
248.Ar a
249to
250.Ar z
251and
252.Ar A
253to
254.Ar Z .
255The
256.Ar _DEFAULT_AT_QUEUE
257queue (a) is the default for
258.Nm at
259and the
260.Ar _DEFAULT_BATCH_QUEUE
261queue (b) is the default for
262.Nm batch .
263Queues with higher letters run with increased niceness.
264If a job is submitted to a queue designated with an uppercase letter, it
265is treated as if it had been submitted to batch at that time.
266If
267.Nm atq
268is given a specific queue, it will only show jobs pending in that queue.
269.It Fl r
270Remove the specified jobs.
271.It Fl t
272Specify the job time using the \*[Px] time format.
273The argument should be in the form
274.Sm off
275.Op Oo Ar CC Oc Ar YY
276.Ar MM DD hh mm Op . Ar SS
277.Sm on
278where each pair of letters represents the following:
279.Pp
280.Bl -tag -width indent -compact -offset indent
281.It Ar CC
282The first two digits of the year (the century).
283.It Ar YY
284The second two digits of the year.
285.It Ar MM
286The month of the year, from 1 to 12.
287.It Ar DD
288the day of the month, from 1 to 31.
289.It Ar hh
290The hour of the day, from 0 to 23.
291.It Ar mm
292The minute of the hour, from 0 to 59.
293.It Ar SS
294The second of the minute, from 0 to 61.
295.El
296.Pp
297If the
298.Ar CC
299and
300.Ar YY
301letter pairs are not specified, the values default to the current
302year.
303If the
304.Ar SS
305letter pair is not specified, the value defaults to 0.
306.It Fl v
307For
308.Nm atq ,
309shows completed but not yet deleted jobs in the queue; otherwise
310shows the time the job will be executed.
311.El
312.Sh FILES
313.Bl -tag -width _ATJOB_DIR/_LOCKFILE -compact
314.It Pa _ATJOB_DIR
315directory containing job files
316(/usr/lib/cron/jobs/)
317.It Pa _ATJOB_DIR/_LOCKFILE
318job-creation lock file
319(/usr/lib/cron/jobs/...)
320.It Pa _ATSPOOL_DIR
321directory containing output spool files
322(/usr/lib/cron/spool/)
323.It Pa _PERM_PATH/at.allow
324allow permission control
325(/usr/lib/cron/at.allow)
326.It Pa _PERM_PATH/at.deny
327deny permission control
328(/usr/lib/cron/at.deny)
329.It Pa /var/run/utmpx
330login records
331.El
332.Sh SEE ALSO
333.Xr nice 1 ,
334.Xr sh 1 ,
335.Xr umask 2 ,
336.Xr compat 5 ,
337.Xr atrun 8 ,
338.Xr cron 8 ,
339.Xr sendmail 8
340.Sh BUGS
341If the file
342.Pa /var/run/utmpx
343is not available or corrupted,
344or if the user is not logged on at the time
345.Nm at
346is invoked, the mail is sent to the userid found
347in the environment variable
348.Ev LOGNAME .
349If that is undefined or empty, the current userid is assumed.
350.Pp
351The
352.Nm at
353and
354.Nm batch
355utilities
356as presently implemented are not suitable when users are competing for
357resources.
358If this is the case, another batch system such as
359.Em nqs
360may be more suitable.
361.Pp
362Specifying a date past 2038 may not work on some systems.
363.Sh AUTHORS
364At was mostly written by
365.An Thomas Koenig Aq ig25@rz.uni-karlsruhe.de .
366The time parsing routines are by
367.An David Parsons Aq orc@pell.chi.il.us ,
368with minor enhancements by
369.An Joe Halpin Aq joe.halpin@attbi.com .