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