at(1)at(1)NAME
at, batch - execute batched commands immediately or at a later time
SYNOPSIS
Enter commands from standard input to run at a specified time:
queue]
commands
eof
queue] time [date] timeunit | timeunit]
commands
eof
Enter commands from a file to run at a specified time:
queue] spectime
queue] time [date] timeunit | timeunit]
List scheduled jobs:
job-id ...
[job-id ...]
queue
Cancel (remove) a scheduled job:
job-id ...
Enter commands from standard input to run as a batch process:
commands
eof
Enter commands from a file to run as a batch process:
DESCRIPTION
The and commands schedule jobs for execution by the daemon (see
cron(1M)).
schedules a job for execution at a specified time. can also list or
remove existing scheduled and jobs.
schedules a job for execution immediately, or as soon as system load
levels permit.
You can enter commands into a job in one of the following ways:
· From the keyboard on separate lines immediately after the or com‐
mand line, followed by the currently defined eof (end-of-file)
character to end the input. The default eof is It can be rede‐
fined in your environment (see stty(1)).
· With the option of the command to read input from a script file.
· From output piped from a preceding command.
Options and Arguments
recognizes the following options and arguments.
commands One or more HP-UX commands that can be exe‐
cuted as a shell script by or
eof End-of-file character. The default is
unless defined otherwise in your environ‐
ment.
job-file The path name of an existing file.
job-id The job identifier reported by or when the
job was originally scheduled.
Displays the contents of the specified job. An unprivileged
user is restricted
to display information only on jobs that the
user owns. A user with the appropriate
privileges is able to display information
about all jobs.
Read in the commands contained in
job-file instead of using standard input.
List the jobs specified.
If no job-ids are given, all jobs are
listed.
Send mail to the invoking user after the job has run,
announcing its completion. Unless redi‐
rected elsewhere within the job, standard
output and standard error produced by the
job are automatically mailed to the user as
well.
Submit the specified job to the
queue indicated (see queuedefs(4)). Queues
and through can be used. uses queue by
default. always uses queue All queues
except require a time or a specification.
is equivalent to When used with the option,
limit the search to that particular queue.
Remove the jobs specified by each
job-id.
Define the absolute time to start the job.
spectime A date and time in the format:
[[CC]YY]MMDDhhmm[.ss]
where the decimal digit pairs are
as follows:
CC The first two digits of the
year
YY The second two digits of
the year See WARNINGS.
MM The month of the year
DD The day of the month
hh The hour of the day
mm The minute of the hour
ss The second of the minute
If both CC and YY are omitted, the
default is the current year.
If CC is omitted and YY is in the
range CC defaults to Otherwise,
defaults to
The range for ss provides for two
leap seconds. If ss is or and the
resulting time, as affected by the
environment variable, does not
refer to a leap second, the time
is set to the whole minute follow‐
ing mm.
If ss is omitted, it defaults to
time [date] Define the base time for starting the job.
time A time specified as one, two, or
four digits. One- and two-digit
numbers represent hours; four dig‐
its represent hours and minutes.
Alternately, time can be specified
as two numbers separated by a
colon a single quote the letter h
a period or a comma Spaces may be
present between the separator and
digits representing minutes. If
defined in langinfo(5), special
time unit characters can be used.
or can be appended to indicate
morning or afternoon. Otherwise,
a 24-hour clock is understood.
For example, and are read as 15
minutes after eight in the morn‐
ing. The suffixes and can be used
to specify Coordinated Universal
Time (UTC), equivalent to Green‐
wich Mean Time (GMT).
The special names and are also
recognized.
date A day of the week (fully spelled
out or abbreviated) or a date con‐
sisting of a day, a month, and
optionally a year. The day and
year fields must be numeric, and
the month can be either fully
spelled out, abbreviated, or
numeric. The fields in the date
string are separated by punctua‐
tion marks such as slash hyphen
period and comma If defined in
langinfo(5), special date unit
characters can be present. A
field having a value greater than
31 is treated as the year field
and the remaining two fields in
the date string are treated as
month and day fields. Otherwise,
if a given date is ambiguous (such
as or the string (if defined in
langinfo(5)) is used to resolve
the ambiguity.
Two special days, and are also
recognized. If no date is given,
is assumed if the given time is
greater than the current time; is
assumed if it is less.
If the given month is less than
the current month (and no year is
given), next year is assumed.
Two-digit years in the range 69 to
99 are expanded to 1969 to 1999;
in the range 00 to 68, to 2000 to
2068.
next timeunit | + count timeunit
Delay the execution date and time by a spe‐
cific number of time units after the base
time specified by time [date].
count A decimal number. is equivalent
to
timeunit A time unit, one of the following:
or or their singular forms.
How Jobs Are Processed
When a job is accepted, and print a message to standard error in the
form:
where job-id is the job identifier in the form such as and execution-
date is the date and time when the job will be released for execution.
If your login shell is not the POSIX shell the commands also print a
warning message:
jobs default to queue jobs always go in queue See the option.
An or job consists of a two-part script stored in that can be executed
by the POSIX shell.
The first part sets up the environment to match the environment when
the or command was issued. This includes the current shell environment
variables, current directory, and (see ulimit(2), umask(1), and
proto(4)). Open file descriptors, traps, and priority are lost.
The second part consists of the commands that you entered.
When dispatches the job, it starts a POSIX shell to execute the script.
The number of jobs executing from a queue at any time is controlled by
parameters in the file (see queuedefs(4)).
Standard output and standard error from the job are mailed to the user
unless they are redirected elsewhere within the job.
Scheduled jobs are immune to the hangup signal, and remain scheduled if
the user logs off.
Users are permitted to use the and commands if their user names appear
in the file If that file does not exist, users can use and if their
names appear in the file If neither file exists, only superuser is
allowed to submit jobs. If only exists but is empty, all users can use
and The files consist of one user name per line.
All users can list and remove their own jobs. Users with appropriate
privileges can list and remove jobs other than their own.
Notes
The command requests a unique job-id for each batch job it schedules.
The maximum number of tries to request a unique job-id is restricted to
100. If not successful after 100 tries, the command exits with the
message You can configure this number by setting the variable in the
file. The value of can be any positive number or the string (the
default value). If the value is set to requests a unique job-id until
it successfully receives one.
The command can schedule only one job per queue for a given time. If a
job is already scheduled for a given time, the command schedules the
new job for the next second. You can remove this limitation by setting
the variable to 1 in the file. If is set to 1, then supports schedul‐
ing multiple jobs for the same time and creates the job-id in the form
, where index is the total number of jobs scheduled for the given time.
You can disable this feature by setting the variable to 0.
Security Restrictions
If the compartmentalization feature is enabled, and invoke the jobs
from the compartment that the jobs were created from. Note that cre‐
ates the job files in Hence, if the command is invoked from a compart‐
ment which has no write access to this directory and which disallows
the privilege, fails to schedule the jobs. See compartments(5) and
privileges(5) for more information.
EXTERNAL INFLUENCES
Environment Variables
determines the format and contents of date and time strings.
determines the language in which messages are displayed.
also determines the language in which the words and their singular
forms can also be specified.
IF or is not specified in the environment or is set to the empty
string, the value of is used as a default for each unspecified or empty
variable. If is not specified or is set to the empty string, a default
of "C" (see lang(5)) is used instead of
If any internationalization variable contains an invalid setting, all
internationalization variables default to "C" (see environ(5)).
International Code Set Support
Single- and multi-byte character code sets are supported.
RETURN VALUE
The exit code is set to one of the following:
Successful completion
Failure
DIAGNOSTICS
produces self-explanatory messages for syntax errors and out-of-range
times.
If your login shell is not the POSIX shell and produce a warning
message as a reminder that and jobs are executed using
EXAMPLES
The following commands show three different ways to run a POSIX shell
script file named five minutes from now:
Run a typical HP-UX command in this case) when system load levels per‐
mit, and redirect standard output and standard error to files:
Run a job contained in in the home directory at 12:20 a.m. on December
27, 2013:
Redirect standard error to a pipe (useful in a shell procedure). Note
that the sequence of the output redirection specifications is signifi‐
cant. Standard error is redirected to where standard output is going;
standard output is redirected to a file; the original "standard output"
(which now consists of the former standard error) is piped to the pro‐
gram.
Run a job contained in in the home directory at 5:00 a.m. next Tuesday:
Run the same job at 5:00 a.m. one week from next Tuesday (i.e., 2 Tues‐
days in advance):
Add a command to the file named in directory in the home directory so
that it automatically reschedules itself every time it runs. This
example reschedules itself every Thursday at 1900 (7:00 p.m.):
The following commands show several forms recognized by and include
native language usage:
WARNINGS
If the date argument begins with a number and the time argument is also
numeric without a suffix, the time argument should be a four-digit num‐
ber that can be correctly interpreted as hours and minutes.
If you use both and within a single command, the first operator is
accepted and the trailing operator is silently ignored.
If you use both and time ... in the same command, the first specified
is accepted and the second is silently ignored.
If the FIFO used to communicate with fills up, is suspended until has
read sufficient messages from the FIFO to make room for the message is
trying to write. This condition can occur if is writing messages
faster than can process them or if is not executing.
Scheduled processes are run in the background. Any script file that
calls itself will cause the user or the system to run out of available
processes.
If the execution-time request for a job duplicates the execution time
of a currently scheduled job, the new job time is set to the next
available second.
will not schedule jobs whose start time precedes the current Epoch
(00:00:00 January 1, 1970 UTC). will not schedule jobs beyond the year
2037.
DEPENDENCIES
HP Process Resource Manager
If the optional HP Process Resource Management (PRM) software is
installed and configured, jobs are launched in the initial process
resource group of the user that scheduled the job. The user's initial
group is determined at the time the job is started, not when the job is
scheduled. If the user's initial group is not defined, the job runs in
the user default group See prmconfig(1) for a description of how to
configure HP PRM, and prmconf(4) for a description of how the user's
initial process resource group is determined.
AUTHOR
was developed by AT&T and HP.
FILES
Configuration file
POSIX shell
List of allowed users
List of denied users
Main directory
This file contains a set of shell commands which are added to the
job file to make the environment for
the job same as the current environ‐
ment. See proto(4).
Scheduling information
Spool area
SEE ALSOcrontab(1), kill(1), mail(1), nice(1), ps(1), sh(1), stty(1), cron(1M),
proto(4), queuedefs(4), compartments(5), privileges(5).
HP Process Resource Manager: prmconfig(1), prmconf(4) in
STANDARDS CONFORMANCEat(1)