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