at(1) at(1)
NAME
at - execute commands at a later time
SYNOPSIS
at [-m] [-f script] [-q queue] -t time Format 1
at [-m] [-f script] [-q queue] [--] time Format 2
at -l [jobnumber]... Format 3
at -r jobnumber ... Format 4
DESCRIPTION
The at command
- reads commands from standard input or a shell script and executes
them at a later time specified by the user (Format 1 and 2)
- lists on standard output any jobs scheduled with at or batch [see
batch(1)] which have not yet been processed (Format 3)
- removes jobs previously scheduled with at or batch (Format 4).
The output from Format 1 and Format 2 is sent to the user by mail
unless the standard output and standard error output of the commands
to be executed have been redirected. The environment variables, the
current directory, the permissions for new files [see umask(1)] and
the maximum permissible file size [see ulimit(1)] are retained, but
open files and priorities are lost, and the trap(1) command (shell
built-in for catching signals) is deactivated.
at writes the job number and the schedule time to standard error. Jobs
scheduled with at are run even if the user who scheduled them logs out
of the system.
Before the call
If the file /etc/cron.d/at.allow exists, you can only use at if your
login name appears in it.
If the file /etc/cron.d/at.allow does not exist, you can only use at
if your login name does not appear in the file /etc/cron.d/at.deny.
If neither /etc/cron.d/at.allow nor /etc/cron.d/at.deny exists, only
the system administrator is allowed to use at.
Page 1 Reliant UNIX 5.44 Printed 11/98
at(1) at(1)
If only an empty deny file exists, for example, everyone is allowed to
use at.
Only the system administrator is allowed to create and modify the
allow and deny files. Each line in these files contains precisely one
login name.
OPTIONS
Format 1: Execute commands at a later time
at [-m] [-f script] [-q queue] -t time
-f script
at reads the commands to be executed from the specified shell
script.
-f not specified:
at reads the commands to be executed from the standard input.
You can specify a number of commands, separated from one another
by a semicolon (;) or a newline character. A command list created
in this way runs under a job number. <CTRL-D> exits the command
list.
-m Sends mail to the user after a job has been completed, indicating
that the job is finished. Mail is sent only if the job has not
already generated a mail message.
-q queue
The -q option is used to assign a job to a specific queue in the
/var/spool/cron directory.
The values accepted for queue are:
a for the default queue for jobs scheduled with at.
b for the default queue for jobs scheduled with batch.
Page 2 Reliant UNIX 5.44 Printed 11/98
at(1) at(1)
-t time
Specifies the execution time for the commands. time is specified
as follows:
[[CC]YY]MMDDhhmm[.SS]
CC The first two digits of a date (century): 19 or 20
CC not specified:
If the two-digit date is greater than 69, the current cen-
tury is assumed, otherwise the following is used.
YY Two-digit year specification
Only the digits >69 and <38 may be entered. If the year
number specified is <38, this is beyond the year 2000.
YY not specified: The current year is assumed.
MM Two-digit month specification (01 through 12)
DD Two-digit day specification (01 through 31)
hh Two-digit hour specification (00 through 23)
mm Two-digit minute specification (00 through 59)
SS Two-digit second specification (00 through 61)
The values 60 and 61 are intended for leap seconds.
SS not specified: The value 0 seconds is assumed.
Page 3 Reliant UNIX 5.44 Printed 11/98
at(1) at(1)
Format 2: Execute commands at a later time
at [-m] [-f script [-q queue] [--] time
The options are described under Format 1.
-- If time begins with a dash (-), the end of the command-line
options must be marked with --.
time Specifies the execution time for the commands. time is specified
as follows: Time [Date] [+Increment]
Time digits[suffix] or specialname
digits
[h]h 1 and 2-digit numbers are
interpreted as hours.
hhmm 4-digit numbers are interpreted
as hours and minutes.
[h]h:[m]m Digits separated by a colon are
interpreted as hours and
minutes.
suffix
am Interpreted as before 12 noon
pm Interpreted as after 12 noon
am, pm omitted Interpreted as 24-hour clock
utc Interpreted as Greenwich Mean
Time
zulu Interpreted as Greenwich Mean
Time
specialname
noon
midnight
now at now on its own will result
in the error message "Too
late".
Page 4 Reliant UNIX 5.44 Printed 11/98
at(1) at(1)
Date month day[,year] or weekday [nextweek] or
specialday
month
jan
feb
mar
apr
may
jun
jul
aug
sep
oct
nov
dec
day A number between 1 and 31, depending on how
long the month is
year Number defining the year to which the date
applies
nextyear selects the following year
year not specified: The current year is
assumed.
weekday
mon[day]
tue[sday]
wed[nesday]
thu[rsday]
fri[day]
sat[urday]
sun[day]
nextweek
selects the following week
Page 5 Reliant UNIX 5.44 Printed 11/98
at(1) at(1)
specialday
today
tomorrow
nextday
nextday means that the job is executed a full
day later.
If the specified time lies before the current
time, at interprets the following day as the
current day. For example, if the job at 10
nextday were scheduled at 11:00am on 7/1/91,
the job would be executed at 10:00am on 7/3/91;
however, if at 14 nextday were specified at the
same time, execution would begin at 14:00 hours
on 7/2/91.
Date not specified:
- corresponds to today if the specified time
(rounded to the nearest minute) lies after the
current time.
- corresponds to tomorrow if the specified time
(rounded to the nearest minute) lies before the
current time.
- corresponds to now if the specified time (rounded
to the nearest minute) is the same as the current
time.
+Increment Is a positive integer that must be followed by one
of the following units of time:
minute[s]
hour[s]
day[s]
week[s]
month[s]
year[s]
Examples: at can typically be specified in the following ways:
at 0815am jan 24
at 8:15am jan 24
at 5pm friday
at now +1hour
Page 6 Reliant UNIX 5.44 Printed 11/98
at(1) at(1)
Format 3: List jobs yet to be processed
at -l [jobnumber]...
-l [jobnumber]
at lists the specified jobnumber if the corresponding job has not
yet been processed. jobnumber is the number that is reported on
standard error when a job is scheduled with at, batch or cron.
jobnumber not specified:
at lists all jobs that are yet to be processed, together with
their job numbers.
Format 4: Remove jobs
at -r jobnumber ...
-r jobnumber
at removes a job previously scheduled with at or batch, where
jobnumber is the number reported on standard error when a job is
scheduled with at or batch. You can specify more than one job
number, using blanks to separate them. Only the system adminis-
trator is allowed to remove another user's jobs.
ERROR MESSAGES
The commonest error messages are:
at: bad date specification
You have entered the date in an incorrect format.
at: too late
You have specified "now" as the value for Time. Since "now" refers to
the time at which at is called, it is always too late as the time for
command execution.
at: you are not authorized to use at. Sorry.
See Before the call.
Page 7 Reliant UNIX 5.44 Printed 11/98
at(1) at(1)
LOCALE
The LCMESSAGES environment variable governs the language in which
message texts are displayed.
The LCTIME environment variable governs the format of date and time
strings.
If LCMESSAGES or LCTIME is undefined or is defined as the null
string, it defaults to the value of LANG. If LANG is likewise unde-
fined or null, the system acts as if it were not internationalized.
If any of the locale variables has an invalid value, the system acts
as if none of the variables were set.
The LCALL environment variable governs the entire locale. LCALL
takes precedence over all the other environment variables which affect
internationalization.
EXAMPLES
The current date and the string April Fool! are to be displayed on
terminal tty013 at 9 o'clock in the morning on the 1st of April.
$ at 9am apr 1 <RETURN>
echo `date`": April Fool!" >> /dev/tty013 <RETURN>
<CTRL-D>
FILES
/etc/cron.d/at.allow
List of login names with permission to use at. One login name is
entered per line.
/etc/cron.d/at.deny
List of login names explicitly denied permission to use at. One
login name is entered per line.
/var/spool/cron/atjobs
Directory containing a separate file for each at job which has
not yet been executed. Each at job is allocated a file of its own
with the file name jobnumber.a.
/etc/cron.d/queuedefs
File containing scheduling information.
SEE ALSO
atq(1), atrm(1), batch(1), calendar(1), date(1), kill(1), mail(1),
nice(1), ps(1), sh(1), sort(1), ulimit(1), cron(1M), getdate(3C),
environ(5).
Page 8 Reliant UNIX 5.44 Printed 11/98