NAME
at - execute commands at a later time
SYNOPSIS
at [ -c ] [ -s ] [ -m ] [ time ] [ day ] [ month ] [ year ]
[
frequency ] [ : file ]
at [ -c ] [ -s ] [ -m ] +minutes [ : file ]
DESCRIPTION
At spools away a copy of the named file (standard input
default) to
be used as input to sh(1) or csh(1) at a specified later
time. If
the -c flag (for (csh(1))) or the -s flag (for (sh(1))) is
specified, then that shell will be used to execute the job;
if no
shell is specified, the current environment shell is used.
If no
file name is specified, at prompts for commands from
standard input
until a ^D is typed. It will also execute the script
periodically
if so requested.
If the -m flag is specified,
mail will be sent to the user after
the job has been run. If errors occur during execution of
the job,
then a copy of the error diagnostics will be sent to the
user. If
no errors occur, then a short message is sent informing the
user
that no errors occurred.
The format of the spool file is
as follows: A four line header that
includes the owner of the job, the name of the job, the
shell used
to run the job, and whether mail will be set after the job
is
executed. The header is followed by a cd command to the
current
directory and a umask command to set the modes on any files
created
by the job. Then at copies all relevant environment
variables to
the spool file. When the script is run, it uses the user and
group
ID of the creator of the spool file.
The format of the time arguments are as follows:
time: [ hour [ : minute ] ] [ modifier ]
modifier: am | pm | noon |
midday | midnight | now |
batchtime
day: ( dayofweek [ week ] ) | 1..31
dayofweek: sunday | ... | saturday | tomorrow | today
month: january | ... | december
year: 1970..1999
frequency: hourly | daily | weekly | monthly | yearly | boot
The arguments time , day , month
and year are order-independent,
and words may be shortened to a non-ambiguous
abbreviation.
As the time must be in the
future, unspecified time , day , month
and year arguments default to the ‘next’ hour,
day, month or year
as necessary; otherwise the current time, day, month and
year are
used.
If at has a single argument
‘+x’ where x is an integer, the script
will be run x minutes from the current time. Whatever
argument
format used at will print a message giving the exact time
the
script will be run.
If the system is down for the
time specified the script will be run
at the earliest system boot time (unless a periodic script,
in
which case it will be run at the next time specified by the
frequency).
Standard output is lost unless
redirected within the script. Error
output is lost unless redirected or the -m flag is
requested, in
which case a copy of the errors is sent to the user via
mail(1).
To get a list of current at
requests the command atq(1) can be
used. To cancel an at request the command atrm(1) can be
used.
If the frequency argument is
used, the script will run at the time
specified, then once a hour/day/week/month/year afterwards
until
removed with atrm(1). The frequency boot causes the script
to be
run every time the system is booted, after the time
specified.
If batchtime is specified the
script will be run at some later
time, determined by the system supervisor (usually at
night), at
low priority. No particular start time is guaranteed.
Frequency
and date are not applicable.
EXAMPLES
at friday week 5pm : run.sh
at Jan 1 17:00 1980 : run.sh
at tomorrow 4:00 : myprog.sh
at +8
FILES
/usr/spool/at/yy.ddd.hhmm[hwdmybB.]*
activity for year yy, day ddd, hour hh and minute mm.
SEE ALSO
alarm(1), atq(1), atrm(1), atd(8).
BUGS
batchtime is unimplemented.