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