1.\" $FreeBSD$ 2.Dd January 13, 2002 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 q Ar queue 14.Op Fl f Ar file 15.Op Fl mldbv 16.Ar time 17.Nm at 18.Op Fl q Ar queue 19.Op Fl f Ar file 20.Op Fl mldbv 21.Fl t 22.Sm off 23.Op Oo Ar CC Oc Ar YY 24.Ar MM DD hh mm Op . Ar SS 25.Sm on 26.Nm at 27.Fl c Ar job Op Ar job ... 28.Nm at 29.Fl r Ar job Op Ar job ... 30.Pp 31.Nm atq 32.Op Fl q Ar queue 33.Op Fl v 34.Pp 35.Nm atrm 36.Ar job 37.Op Ar job ... 38.Pp 39.Nm batch 40.Op Fl q Ar queue 41.Op Fl f Ar file 42.Op Fl mv 43.Op Ar time 44.Sh DESCRIPTION 45.Nm \&At 46and 47.Nm batch 48read commands from standard input or a specified file which are to 49be executed at a later time, using 50.Xr sh 1 . 51.Bl -tag -width indent 52.It Nm at 53executes commands at a specified time; 54.It Nm atq 55lists the user's pending jobs, unless the user is the superuser; in that 56case, everybody's jobs are listed; 57.It Nm atrm 58deletes jobs; 59.It Nm batch 60executes commands when system load levels permit; in other words, when the load average 61drops below _LOADAVG_MX, or the value specified in the invocation of 62.Nm atrun . 63.El 64.Pp 65.Nm \&At 66allows some moderately complex 67.Ar time 68specifications. 69It accepts times of the form 70.Ar HHMM 71or 72.Ar HH:MM 73to run a job at a specific time of day. 74(If that time is already past, the next day is assumed.) 75As an alternative, the following keywords may be specified: 76.Em midnight , 77.Em noon , 78or 79.Em teatime 80(4pm) 81and time-of-day may be suffixed with 82.Em AM 83or 84.Em PM 85for running in the morning or the evening. 86The day on which the job is to be run may also be specified 87by giving a date in the form 88.Ar \%month-name day 89with an optional 90.Ar year , 91or giving a date of the forms 92.Ar DD.MM.YYYY , 93.Ar DD.MM.YY , 94.Ar MM/DD/YYYY , 95.Ar MM/DD/YY , 96.Ar MMDDYYYY , or 97.Ar MMDDYY . 98The specification of a date must follow the specification of 99the time of day. 100Time can also be specified as: 101.Op Em now 102.Em + Ar count \%time-units , 103where the time-units can be 104.Em minutes , 105.Em hours , 106.Em days , 107.Em weeks , 108.Em months 109or 110.Em years 111and 112.Nm 113may be told to run the job today by suffixing the time with 114.Em today 115and to run the job tomorrow by suffixing the time with 116.Em tomorrow . 117.Pp 118For example, to run a job at 4pm three days from now, use 119.Nm at Ar 4pm + 3 days , 120to run a job at 10:00am on July 31, use 121.Nm at Ar 10am Jul 31 122and to run a job at 1am tomorrow, use 123.Nm at Ar 1am tomorrow . 124.Pp 125The 126.Nm at 127utility also supports the \*[Px] time format (see 128.Fl t 129option). 130.Pp 131For both 132.Nm 133and 134.Nm batch , 135commands are read from standard input or the file specified 136with the 137.Fl f 138option and executed. 139The working directory, the environment (except for the variables 140.Ev TERM , 141.Ev TERMCAP , 142.Ev DISPLAY 143and 144.Em _ ) 145and the 146.Ar umask 147are retained from the time of invocation. 148An 149.Nm 150or 151.Nm batch 152command invoked from a 153.Xr su 1 154shell will retain the current userid. 155The user will be mailed standard error and standard output from his 156commands, if any. 157Mail will be sent using the command 158.Xr sendmail 8 . 159If 160.Nm 161is executed from a 162.Xr su 1 163shell, the owner of the login shell will receive the mail. 164.Pp 165The superuser may use these commands in any case. 166For other users, permission to use 167.Nm 168is determined by the files 169.Pa _PERM_PATH/at.allow 170and 171.Pa _PERM_PATH/at.deny . 172.Pp 173If the file 174.Pa _PERM_PATH/at.allow 175exists, only usernames mentioned in it are allowed to use 176.Nm . 177.Pp 178If 179.Pa _PERM_PATH/at.allow 180does not exist, 181.Pa _PERM_PATH/at.deny 182is checked, every username not mentioned in it is then allowed 183to use 184.Nm Ns . 185.Pp 186If neither exists, only the superuser is allowed use of 187.Nm Ns . 188This is the default configuration. 189.Sh OPTIONS 190.Bl -tag -width indent 191.It Fl q Ar queue 192Use the specified queue. 193A queue designation consists of a single letter; valid queue designations 194range from 195.Ar a 196to 197.Ar z 198and 199.Ar A 200to 201.Ar Z . 202The 203.Ar _DEFAULT_AT_QUEUE 204queue is the default for 205.Nm 206and the 207.Ar _DEFAULT_BATCH_QUEUE 208queue for 209.Nm batch . 210Queues with higher letters run with increased niceness. 211If a job is submitted to a queue designated with an uppercase letter, it 212is treated as if it had been submitted to batch at that time. 213If 214.Nm atq 215is given a specific queue, it will only show jobs pending in that queue. 216.It Fl m 217Send mail to the user when the job has completed even if there was no 218output. 219.It Fl f Ar file 220Read the job from 221.Ar file 222rather than standard input. 223.It Fl l 224Is an alias for 225.Nm atq . 226.It Fl d 227Is an alias for 228.Nm atrm 229(this option is deprecated; use 230.Fl r 231instead). 232.It Fl b 233Is an alias for 234.Nm batch . 235.It Fl v 236For 237.Nm atq , 238shows completed but not yet deleted jobs in the queue; otherwise 239shows the time the job will be executed. 240.It Fl c 241Cat the jobs listed on the command line to standard output. 242.It Fl r 243Remove the specified jobs. 244.It Fl t 245Specify the job time using the \*[Px] time format. 246The argument should be in the form 247.Sm off 248.Op Oo Ar CC Oc Ar YY 249.Ar MM DD hh mm Op . Ar SS 250.Sm on 251where each pair of letters represents the following: 252.Pp 253.Bl -tag -width indent -compact -offset indent 254.It Ar CC 255The first two digits of the year (the century). 256.It Ar YY 257The second two digits of the year. 258.It Ar MM 259The month of the year, from 1 to 12. 260.It Ar DD 261the day of the month, from 1 to 31. 262.It Ar hh 263The hour of the day, from 0 to 23. 264.It Ar mm 265The minute of the hour, from 0 to 59. 266.It Ar SS 267The second of the minute, from 0 to 61. 268.El 269.Pp 270If the 271.Ar CC 272and 273.Ar YY 274letter pairs are not specified, the values default to the current 275year. 276If the 277.Ar SS 278letter pair is not specified, the value defaults to 0. 279.El 280.Sh FILES 281.Bl -tag -width _ATJOB_DIR/_LOCKFILE -compact 282.It Pa _ATJOB_DIR 283directory containing job files 284.It Pa _ATSPOOL_DIR 285directory containing output spool files 286.It Pa /var/run/utmp 287login records 288.It Pa _PERM_PATH/at.allow 289allow permission control 290.It Pa _PERM_PATH/at.deny 291deny permission control 292.It Pa _ATJOB_DIR/_LOCKFILE 293job-creation lock file 294.El 295.Sh SEE ALSO 296.Xr nice 1 , 297.Xr sh 1 , 298.Xr umask 2 , 299.Xr atrun 8 , 300.Xr cron 8 , 301.Xr sendmail 8 302.Sh BUGS 303If the file 304.Pa /var/run/utmp 305is not available or corrupted, or if the user is not logged on at the 306time 307.Nm 308is invoked, the mail is sent to the userid found 309in the environment variable 310.Ev LOGNAME . 311If that is undefined or empty, the current userid is assumed. 312.Pp 313.Nm \&At 314and 315.Nm batch 316as presently implemented are not suitable when users are competing for 317resources. 318If this is the case, another batch system such as 319.Em nqs 320may be more suitable. 321.Pp 322Specifying a date past 2038 may not work on some systems. 323.Sh AUTHORS 324At was mostly written by 325.An Thomas Koenig Aq ig25@rz.uni-karlsruhe.de . 326The time parsing routines are by 327.An David Parsons Aq orc@pell.chi.il.us , 328with minor enhancements by 329.An Joe Halpin Aq joe.halpin@attbi.com . 330