Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ at(1) — HP-UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cron(1M)

crontab(1)

kill(1)

mail(1)

nice(1)

ps(1)

sh(1)

hpnls(5)

AT(1)  —  HP-UX

NAME

at, batch − execute commands at a later time

SYNOPSIS

at time [ date ] [ + increment ]
at −r job ... 
at −l [ job ...  ]

batch

DESCRIPTION

At and batch read commands from standard input to be executed at a later time.  At allows you to specify when the commands should be executed, while jobs queued with batch will execute when system load level permits.  At -r removes jobs previously scheduled with at.  The -l option reports all jobs scheduled for the invoking user. 

Standard output and standard error output are mailed to the user unless they are redirected elsewhere.  The shell environment variables, current directory, umask, and ulimit are retained when the commands are executed.  Open file descriptors, traps, and priority are lost. 

A user is permitted to use at if his/her name appears in the file /usr/lib/cron/at.allow.  If that file does not exist, the file /usr/lib/cron/at.deny is checked to determine if the user should be denied access to at.  If neither file exists, only root is allowed to submit a job.  If only at.deny exists and is empty, global usage is permitted.  The allow/deny files consist of one user name per line. 

The time can be specified as 1, 2, or 4 digits.  One and two digit numbers are taken to be hours, four digits to be hours and minutes.  The time may alternately be specified as two numbers separated by one of the following characters: : , ’ , h , .  or , .  If defined in langinfo(3C), special time unit characters can also be used. A suffix am or pm can be appended; otherwise a 24-hour clock time is understood.  For example, 8:15, 8’15, 8h15, 8.15 and 8,15 are read as 15 minutes after 8 in the morning.  The suffix zulu may be used to indicate GMT.  The special names noon, midnight, and now are also recognized. 

An optional date can be specified as either a day of the week (fully spelled or abbreviated) or a date consisting of a day, a month, and optionally a year.  The day and year fields must be numeric, and the month can either be fully spelled, abbreviated or numeric.  These three fields can be in any order, and separated by punctuation marks such as /, -, .  or ,.  If defined in langinfo(3C), special date unit character(s) can also be present. Two special “days”, today and tomorrow, are also recognized.  If no date is given, today is assumed if the given time is greater than the current time and tomorrow 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.  If a given date is ambiguous (such as 2/5), the D_T_FMT string (if defined in langinfo(3C)) will be used to resolve the ambiguity.

The optional increment is simply a number suffixed by one of the following: minutes, hours, days, weeks, months, or years.  The singular form is also accepted. 

The words today, tomorrow, noon, midnight, now, minutes, hours, days, weeks, months, years and their singular forms are replaced by the local language equivalent when the LANG variable is defined other than n-computer.  Translation of these words should be placed in the corresponding message catalog file for at(1).

At and batch write the job number and schedule time to standard error. 

Batch submits a batch job.  It is almost equivalent to “at now”, but not quite.  For one, it goes into a different queue.  For another, “at now” will respond with the error message too late. 

At -r removes jobs previously scheduled by at or batch. The job number is the number given to you previously by the at or batch command.  You can also get job numbers by typing at -l.  You can only remove your own jobs unless you are the super-user. 

DIAGNOSTICS

At complains about syntax errors and times out of range. 

If the given time is equal to the current time (in hours and minutes), at returns an error message that reads "too late". 

EXAMPLES

The at and batch commands read from standard input the commands to be executed at a later time.  Sh(1) provides different ways of specifying standard input. Within your commands, it may be useful to redirect standard output.

The following sequence can be used at a terminal to redirect output:

batch
nroff filename >outfile
<control-D> (hold down ’control’ and depress ’D’)

This sequence, which demonstrates redirecting standard error to a pipe, is useful in a shell procedure.  Note that the sequence of output redirection specifications is significant:

batch <<!
nroff filename 2>&1 >outfile | mail loginid
!

To have a job reschedule itself, invoke at from within the shell procedure by including code similar to the following within the shell file:

echo "sh shellfile" | at 1900 thursday next week

The following commands show several forms recognized by at and include native language usage:

at 0815 Jan 24
at 8:15 Jan 24
at 9:30am tomorrow
at now + 1 day
at 5 pm Friday

at 17:40 Tor. /* in Danish */
at 17h46 demain /* in French */
at 5:30  26. Feb. 1988 /* in German */
at 12:00 26-02 /* in Finnish */

WARNINGS

If the date argument begins with a number and the time argument is also numeric without suffix, the time argument should be a four-digit number and is interpreted as hours and minutes. 

AUTHOR

At was developed by AT&T and HP. 

FILES

/usr/lib/cron main cron directory
/usr/lib/cron/at.allow list of allowed users
/usr/lib/cron/at.deny list of denied users
/usr/spool/cron/atjobs spool area
/usr/lib/cron/queuedefs scheduling information

SEE ALSO

cron(1M), crontab(1), kill(1), mail(1), nice(1), ps(1), sh(1), hpnls(5). 

INTERNATIONAL SUPPORT

at:  8- and 16-bit data, 8-bit file names, messages. 

Hewlett-Packard Company  —  May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026