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