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