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