xref: /netbsd-src/usr.bin/at/at.1 (revision ae9172d6cd9432a6a1a56760d86b32c57a66c39c)
1.\"
2.\" Copyright (c) 1993 Christopher G. Demetriou
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\" 3. All advertising materials mentioning features or use of this software
14.\"    must display the following acknowledgement:
15.\"      This product includes software developed by Christopher G. Demetriou.
16.\" 3. The name of the author may not be used to endorse or promote products
17.\"    derived from this software without specific prior written permission
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29.\"
30.\"	$Id: at.1,v 1.4 1994/11/03 15:37:46 jtc Exp $
31.\"
32.Dd December 5, 1993
33.Dt "AT" 1
34.Os NetBSD 0.9a
35.Sh NAME
36.Nm at, batch, atq, atrm
37.Nd queue, examine, or delete jobs for later execution
38.\"
39.Sh SYOPSIS
40.Nm at
41.Op Fl q Ar queue
42.Op Fl f Ar file
43.Op Fl m
44.Ar time
45.Pp
46.Nm atq
47.Op Fl q Ar queue
48.Op Fl v
49.Pp
50.Nm atrm
51.Ar job
52.Op Ar job ...
53.Pp
54.Nm batch
55.Op Fl f Ar file
56.Op Fl m
57.Sh DESCRIPTION
58The
59.Nm at
60and
61.Nm batch
62utilities read commands from the standard input or a specified file
63which are to be executed at a later time, using
64.Xr sh 1 .
65.Pp
66The functions of the commands are as follows:
67.Bl -tag -width indent
68.It Nm at
69Executes commands at a specified time.
70.It Nm atq
71Lists the user's pending jobs, unless the user is
72the superuser.  In that case, everybody's jobs are
73listed.
74.It Nm atrm
75Deletes jobs.
76.It Nm batch
77executes commands when system load levels  permit.
78In other words, it executes the commands when the load
79average drops below a specified level.
80.El
81.Pp
82For both
83.Nm at
84and
85.Nm batch ,
86the working directory, environment (except for the variables
87.Nm TERM ,
88.Nm TERMCAP ,
89.Nm DISPLAY ,
90and
91.Nm _ )
92and the umask are retained from the time of invocation.  The user
93will be mailed the standard output and standard error from
94his commands if any output is generated.  If
95.Nm at
96is executed from a
97.Xr su 1
98shell, the owner of the login shell will receive the mail.
99.Sh OPTIONS
100.Bl -tag -width indent
101The available options are as follows:
102.It Fl q Ar queue
103Use the specified queue.  A queue designation consists
104of a single letter; valid queue designation range from
105.Ar a
106to
107.Ar l .
108The
109.Ar a
110queue is the default, and
111.Ar b
112is the batch queue.  Queues with higher letters run with
113increased niceness.  If
114.Nm atq
115is given a specific queue, it will only show jobs pending
116in that queue.
117.It Fl m
118Send mail to the user when the job has completed, even if
119there was no output.
120.It Fl f Ar file
121Reads the job from
122.Ar file
123rather than the standard input.
124.It Fl v
125Shows completed but not yet deleted jobs in the queue.
126.Sh TIME SPECIFICATION
127.Nm At
128allows some moderately complex time specifications.
129It accepts times of the form
130.Ar HHMM
131or
132.Ar HH:MM
133to run a job at a specific time of day.  If
134that time is already passed, the next day is assumed.
135You may also specify
136.Nm midnight ,
137.Nm noon ,
138or
139.Nm teatime
140(4PM) and you can give a time of day suffixed with
141.Nm AM
142or
143.Nm PM
144for running in the morning or the evening.  You can
145also specify the date on which the job will be run
146by giving a date in the form
147.Ar month-name day
148with an optional
149.Ar year ,
150or giving a date of the form
151.Ar MMDDYY ,
152.Ar MM/DD/YY
153or
154.Ar DD.MM.YY .
155You can also give times like
156.Nm now +
157.Ar count time-units ,
158where the time units can be
159.Nm minutes, hours, days,
160or
161.Nm weeks
162You can suffix the time with
163.Nm today
164to run the job today, or
165.Nm tomorrow
166to run the job tomorrow.
167.Pp
168For example, to run a job at 4PM three days from now, you
169would specify a time of
170.Nm 4PM + 3 days .
171To run a job at 10:00AM on on July 31, you would specify
172a time of
173.Nm 10AM Jul 31 .
174Finally, to run a job at 1AM tomorrow, you would specify
175a time of
176.Nm 1AM tomorrow .
177.Sh FILES
178.Bl -tag -width /var/at/lockfile -compact
179.It Pa /var/at/jobs
180Directory containing job files
181.It Pa /var/at/spool
182Directory containing output spool files
183.It Pa /var/at/lockfile
184Job-creation lock file.
185.It Pa /var/run/utmp
186.El
187.Sh SEE ALSO
188.Xr cron 8 ,
189.Xr nice 1 ,
190.Xr sh 1 ,
191.Xr atrun 8
192.Sh AUTHOR
193.Bl -tag
194Thomas Koenig, ig25@rz.uni-karlsruhe.de
195.El
196.Sh BUGS
197Traditional access control to
198.Nm at
199and
200.Nm batch
201via the files
202.Pa /var/at/at.allow
203and
204.Pa /var/at/at.deny
205is not implemented.
206.Pp
207If the file
208.Pa /var/run/utmp
209is not available or corrupted, or if the user is not
210logged in at the time
211.Nm at
212is invoked, the mail is sent to the userid found in the
213environment variable
214.Nm LOGNAME .
215If that is undefined or empty, the current userid is assumed.
216