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