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