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