Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

AT(1)                                BSD                                 AT(1)



NAME
     at - execute commands later

SYNOPSIS
     at [ -c ][ -s ][ -m ] time [ day ] [ file ]

DESCRIPTION
     The at command retains a copy of the named file in a spooling area
     (usr/spool/at), to be used as input to sh(1) or csh(1).  If you specify
     the -c flag (for csh(1)) or the -s flag (for sh(1)), at uses the
     specified shell to execute the job; if you don't specify a shell, at uses
     the current environment shell.  If you don't specify a filename, at
     prompts for commands from standard input until you type a CTRL/D.

     The format of the spool file is as follows: the file contains a four-line
     header which includes the owner of the job, the name of the job, the
     shell used to run the job, and indicates whether mail will be sent 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 spool file's creator.

     The time argument can be one to four digits, optionally ending in A, P,
     N, or M for AM, PM, noon, or midnight, respectively.  at interprets one-
     and two-digit numbers as hours; three- and four-digit numbers as hours
     and minutes.  If no letters follow the digits, at assumes a 24-hour
     clock.

     The optional day is either a month name followed by a day number, or a
     day of the week.  If the word week follows, invocation is moved seven
     days further off.  You can use recognizable abbreviations for the names
     of months and days.

     at programs are run by periodic execution of the command /usr/lib/atrun
     from cron(8).  The granularity of at depends upon how often atrun is
     executed.

     Error output is lost unless you redirect it or request the -m flag, in
     which case a copy of the errors is sent to you via mail(1).

OPTIONS
     -c        Use csh(1) to execute the job.

     -m        Send mail to the user after the job has been run. If errors
               occur during execution of the job, send a copy of the error
               diagnostics to the user. If no errors occur, send a short
               message informing the user that no errors occurred.

     -s        Use sh(1) to execute the job.



EXAMPLES
     To run agenda at 8 a.m. on January 24, enter the following command:

          at 8am jan 24 agenda

     To run agenda as input to csh at 3:30 p.m. a week from next Friday, and
     receive mail after the file is executed, enter the following:

          at -c -m 1530 fr week agenda

     To run agenda as input to sh at 12:00 noon a week from today, and receive
     mail after the file is executed, enter the following:

          at -s -m 1200n week agenda

BUGS
     Due to the granularity of the execution of /usr/lib/atrun from cron(1),
     problems may occur if you schedule activities to take place almost
     exactly 24 hours in the future.

     If the system crashes, at does not send you mail informing you that the
     job wasn't completed.

     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 the files be removed by hand.

DIAGNOSTICS
     at complains about various syntax errors and times out of range.

FILES
     /usr/lib/atrun       Executor; run by cron(8).
     /usr/spool/at        Spooling area
     /usr/spool/at/yy.ddd.hhhh.*Job file; activity for year yy, day dd, hour
     hhhh
     /usr/spool/at/lasttimedoneLast time atrun was run
     /usr/spool/at/past   Directory where jobs are executed from

SEE ALSO
     atq (1), atrm (1), calendar (1), pwd (1), sleep (1), cron (8)

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