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