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