1.\" $FreeBSD$ 2.Dd April 12, 1995 3.Dt "AT" 1 4.Os FreeBSD 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 at is determined by the files 152.Pa _PERM_PATH/at.allow 153and 154.Pa _PERM_PATH/at.deny . 155.Pp 156If the file 157.Pa _PERM_PATH/at.allow 158exists, only usernames mentioned in it are allowed to use 159.Nm . 160.Pp 161If 162.Pa _PERM_PATH/at.allow 163does not exist, 164.Pa _PERM_PATH/at.deny 165is checked, every username not mentioned in it is then allowed 166to use 167.Nm Ns . 168.Pp 169If neither exists, only the superuser is allowed use of 170.Nm Ns . 171This is the default configuration. 172.Pp 173An empty 174.Pa _PERM_PATH/at.deny 175means that every user is allowed use these commands. 176.Sh OPTIONS 177.Bl -tag -width indent 178.It Fl V 179Print the version number to standard error. 180.It Fl q Ar queue 181Use the specified queue. 182A queue designation consists of a single letter; valid queue designations 183range from 184.Ar a 185to 186.Ar z 187and 188.Ar A 189to 190.Ar Z . 191The 192.Ar _DEFAULT_AT_QUEUE 193queue is the default for 194.Nm 195and the 196.Ar _DEFAULT_BATCH_QUEUE 197queue for 198.Nm batch . 199Queues with higher letters run with increased niceness. 200If a job is submitted to a queue designated with an uppercase letter, it 201is treated as if it had been submitted to batch at that time. 202If 203.Nm atq 204is given a specific queue, it will only show jobs pending in that queue. 205.It Fl m 206Send mail to the user when the job has completed even if there was no 207output. 208.It Fl f Ar file 209Read the job from 210.Ar file 211rather than standard input. 212.It Fl l 213Is an alias for 214.Nm atq . 215.It Fl d 216Is an alias for 217.Nm atrm . 218.It Fl b 219Is an alias for 220.Nm batch . 221.It Fl v 222For 223.Nm atq , 224shows completed but not yet deleted jobs in the queue; otherwise 225shows the time the job will be executed. 226.It Fl c 227Cat the jobs listed on the command line to standard output. 228.El 229.Sh FILES 230.Bl -tag -width _ATJOB_DIR/_LOCKFILE -compact 231.It Pa _ATJOB_DIR 232directory containing job files 233.It Pa _ATSPOOL_DIR 234directory containing output spool files 235.It Pa /var/run/utmp 236login records 237.It Pa _PERM_PATH/at.allow 238allow permission control 239.It Pa _PERM_PATH/at.deny 240deny permission control 241.It Pa _ATJOB_DIR/_LOCKFILE 242job-creation lock file 243.El 244.Sh SEE ALSO 245.Xr nice 1 , 246.Xr sh 1 , 247.Xr umask 2 , 248.Xr atrun 8 , 249.Xr cron 8 , 250.Xr sendmail 8 251.Sh BUGS 252If the file 253.Pa /var/run/utmp 254is not available or corrupted, or if the user is not logged on at the 255time 256.Nm 257is invoked, the mail is sent to the userid found 258in the environment variable 259.Ev LOGNAME . 260If that is undefined or empty, the current userid is assumed. 261.Pp 262.Nm \&At 263and 264.Nm batch 265as presently implemented are not suitable when users are competing for 266resources. 267If this is the case for your site, you might want to consider another 268batch system, such as 269.Em nqs . 270.Sh AUTHORS 271At was mostly written by 272.An Thomas Koenig Aq ig25@rz.uni-karlsruhe.de . 273The time parsing routines are by 274.An David Parsons Aq orc@pell.chi.il.us . 275