at, batch - Runs commands at a later time
at [-c|-s|-k] [-m] [-f file] [-q queuename] time [date] [+increment] [command|file]...
at [-c|-s|-k] [-m] [-f file] [-q queuename] -t [[cc]yy]MMddhhmm[.ss]
at -l -o [-q queuename] [user...]
at -l [job_number]
at -r [-Fi] job_number...|[-u user]
at -n [user]
from standard input or accept as arguments the names of commands to be run
at a later time. The
command lets you specify when
the commands are to be run. The
command runs jobs
when the system load level permits.
Interfaces documented on this reference page conform to industry standards as follows:
at: XPG4, XPG4-UNIX
batch: XPG4, XPG4-UNIX
Refer to the
reference page for more information
about industry standards and associated tags.
[Compaq] Requests that csh be used for executing this job. Specifies the name of the file to use instead of stdin. The specified file contains the list of commands to be executed. [Compaq] Suppresses delete verification. [Compaq] Specifies interactive delete. [Compaq] Requests that ksh be used for executing this job. Reports your scheduled jobs.
[Compaq] The operands associated with the
specify the time at which the job should be run. They are described in the
Specifying a Time and Date.
Both at and batch mail you the standard output and standard error from the scheduled commands, unless you redirect that output. They also write the job number and the scheduled time to standard error.
If a filename specified on an at command line is executable (that is, has the x permission for the user in question), at assumes that it is a command and the job consists of this command only. If the file is not executable, at assumes that you want its contents to be the instructions for the job (same as BSD at).
[Compaq] If at cannot find the file at all, the specification is passed to the date parser. If the specification is not recognized by the date parser, the user receives the error Unknown word.
[Compaq] The at command defaults to the Bourne shell. Use the -c option to specify the C shell, or the -k option to specify the Korn shell. Variables in the shell environment, the current directory, umask, and ulimit are retained when the commands run. The value of SHELL is set to be consistent with the shell actually used. Open file descriptors, traps, and priority are lost.
You can use at if your login name appears in the /usr/lib/cron/at.allow file, if that file exists, or if there is no at.allow file and your name is not in the /usr/lib/cron/at.deny file. The at.allow and at.deny files contain one user name per line. Note that /usr/lib/cron is symbolically linked to /var/adm/cron.
If neither the at.allow nor the at.deny file exists, only someone with root user authority can submit a job.
To allow global access to
at, the system administrator
can remove the
file and create a zero-length
You must specify a time argument with these commands. You can specify optionally the date argument. These arguments are affected when the DATEMSK environment variable is set. The next subsection describes the effect of this environment variable.
The required time argument can be one of the following: A number followed by an optional suffix. The at command interprets 1- and 2-digit numbers as hours. It interprets 4 digits as hours and minutes. The LC_TIME environment variable specifies the order of hours and minutes. The default order is the hour followed by the minute. You can also separate hours and minutes with a : (colon). The default order is hour:minute. In addition, you can specify a suffix of am, pm, or zulu. If you do not specify am or pm, at uses a 24-hour clock. The suffix zulu indicates that the time is UTC (Coordinated Universal Time). The at command also recognizes the following keywords as special times: noon, midnight, now, A for a.m., P for p.m., N for noon, and M for midnight. The time argument specifies a time in the future. For example, if the current time is 9:02 p.m., and you specify a time of 9P, the command is executed at 9 p.m. the next day. However, if the current time is 8:58 p.m. and you specify 9P, the command is executed in two minutes. The LC_TIME environment variable controls the keywords that at recognizes. Keywords are defined on a locale basis, however, none of the locales shipped with the base operating system use this feature. All locales use English names for the keywords.
You can specify the date argument as either a month name and a day number (and possibly a year number preceded by a comma), or a day of the week. The LC_TIME environment variable specifies the order of the month name and day number (by default, month followed by day). The at command recognizes two special days, today and tomorrow by default. The special day today is the default date if the specified time is later than the current hour; the special day tomorrow is the default if the time is earlier than the current hour. If the specified month is less than the current month (and a year is not given), next year is the default year.
The optional increment can be one of the following: A + (plus sign) followed by a number and one of the following words: minute[s], hour[s], day[s], week[s], month[s], year[s] (or their non-English equivalents). The special word next followed by one of the following words: minute[s], hour[s], day[s], week[s], month[s], year[s] (or their non-English equivalents).
Job numbers are specified as follows: user.xxxxxxxxx.y
[Compaq] The user argument identifies the user who scheduled the job; xxxxxxxxx is a 9-digit number (encoded time for the job); and y indicates the job type or queue name as follows:
[Compaq] If the DATEMSK environment variable is set, it points to a template file that the at command uses to determine the valid time and date arguments instead of the values described in the previous section. Specifically, noon, midnight, now, next, today, tomorrow, and increment are not recognized when the DATEMSK environment variable is set.
[Compaq] The entries in the template file used by the
environment variable provide an expansive set of date
formats available in different languages depending on the setting of the environment
reference page contains the list
of field descriptors allowed in the template file. This list is a sublist
of the field descriptors supported by the
which are listed on the
[Compaq] It is recommended that you not use unspecified queues (queues
f). The results are unspecified.
The following exit values are returned:
command successfully submitted, removed, or listed
all specified jobs.
An error occurred.
To schedule a command from a terminal, enter a command similar to one of the following: at 5 pm Friday uuclean at now next week uuclean at now + 2 days uuclean
List of allowed users
List of denied users
Commands: atq(1), atrm(1), calendar(1), csh(1), cron(8), date(1), kill(1), mail(1), binmail(1), ksh(1), mailx(1), Mail(1), nice(1), ps(1), Bourne shell sh(1b), POSIX shell sh(1p)
System Administration Guide
Network Administration Guide
Command and Shell User's Guide