Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

atq(1)

atrm(1)

cron(8)

AT(1)  —  USER COMMANDS

NAME

at − execute commands at a later time

SYNOPSIS

at [ −csm ] time [ date ] [ week ] [ script ]

DESCRIPTION

at spools a copy of the named script for execution at a later date or time.  script is the name of a file to be used as command input for the Bourne shell, sh(1), the C-Shell, csh(1), or an arbitrary shell specified by the SHELL environment variable.

The time argument consists of 1 to 4 digits, followed by an optional ‘A’ or ‘P’ for AM or PM (if no letters follow the digits, a 24-hour clock is assumed).  One- and two-digit numbers are taken to be hours; three and four digits specify hours and minutes.  An optional colon (‘:’) may be used to separate the hour and minute fields.  Alternatively, ‘N’ or ‘M’, optionally preceded by ‘12’, ‘1200’, or ‘12:00’, may be used to specify noon or midnight. 

The optional date argument is either the name of a month, followed by a day-of-the-month number, or a named day-of-the-week; if the keyword week follows, execution is moved out by seven days.  Names of months and days can be abbreviated, as long as the abbreviation is unambiguous. 

If script is omitted, command input is accepted from the standard input. 

The spool file includes a four-line header that indicates the owner of the job, the name of the script the shell is to use, and whether mail is to be sent. 

This header is followed by a cd command to the current directory (from which at was called) and a umask command to set the modes on any files created by the job.  at also copies all relevant environment variables to the spool file. 

script is run with the user and group IDs of whoever created the spool file (the user who invoked the at command). 

at jobs are started by periodic execution of the command /usr/lib/atrun from cron(8). The precise timing of each at job depends upon the how often atrun is executed. 

OPTIONS

−c C-Shell.  csh(1) is used to execute script. 

−s Standard (Bourne) shell.  sh(1) is used to execute the job.

If neither −c, nor −s is specified, at uses the value of the SHELL environment variable to determine which shell to use. 

−m Mail.  Send mail after the job has been run.  If errors occur during execution of the script, then resulting error messages are included in the mail message.  When −m is omitted, error output is lost (unless redirected within the script itself). 

EXAMPLES

at 8am jan 24
at -s 1200n week
at -c -m 1530 fr week

DIAGNOSTICS

Complains about various syntax errors and times that are out of range. 

FILES

/usr/spool/at spooling area

/usr/spool/at/yy.ddd.hhhh.∗ job file

/usr/spool/at/past directory where jobs are executed from

/usr/spool/at/lasttimedone last time atrun was run

/usr/lib/atrun job initiator (run by cron(8))

SEE ALSO

atq(1), atrm(1), cron(8)

BUGS

Due to the granularity of the execution of /usr/lib/atrun, there may be bugs in scheduling jobs almost exactly 24 hours ahead. 

If the system crashes, mail stating that the job was not completed is not sent to the user. 

Sometimes old spool files are not removed from the directory /usr/spool/at/past.  This is usually due to a system crash, and requires that these files be removed by hand. 

Shell interpreter specifiers (e.g., #!/bin/csh ) in the beginning of script are ignored. 

Sun Release 3.2  —  Last change: 17 July 1986

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