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