.\" Copyright (c) 1980, 1990, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)at.1 8.1 (Berkeley) 6/29/93 .\" .Dd June 29, 1993 .Dt AT 1 .Os BSD 4 .Sh NAME .Nm at .Nd schedule execution of commands `at' a given time .Sh SYNOPSIS .Nm at .Op Fl c .Op Fl m .Op Fl s .Ar time .Op Ar day .Op Ar command_file .Sh DESCRIPTION .Nm At schedules execution of commands at the specified .Ar time . The commands may be given to .Nm via the .Ar command_file or accepted from the standard input. .Nm At will pass these commands to the appropriate shell at the requested time. While awaiting execution, the jobs reside in a spool directory and may be examined by the .Xr atq 1 program. .Pp Options available: .Bl -tag -width Ds .It Fl c .Ar Command_file contains .Xr csh 1 commands. .It Fl s .Ar Command_file contains .Xr sh 1 commands. .It Fl m 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. .El .Pp If a .Ar command_file is not specified, .Nm at prompts for commands from standard input until a .Ql \&^D is typed. .Pp 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 sent after the job is executed. The header is followed by a .Nm cd command to the current directory and a .Nm umask command to set the modes on any files created by the job. .Nm 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. .Pp The .Ar time is either a 24 hour military time .Em hhmm, where .Em hh is hour and .Em mm is minutes, or the traditional 12 hour time with qualifying options: .Pp .Bl -tag -width "am , a" -offset 12n -compact .It Li am , a am .It Li pm , p pm .It Li n noon .It Li m midnight .El .Pp The time can be abbreviated as shown below in EXAMPLES. .Pp A .Ar day of the week may be specified by the first two letters of its name. A week (7 days) may be specified by the argument .Ar week . If a month name is given, the following argument is expected to be the day (numeric). .Sh ENVIRONMENT If a shell is not specified, the current environment variable .Ev SHELL is used. .Sh EXAMPLES .Bl -tag -width Ds .It Li at 10p Execute at 10pm today, or tomorrow if 10pm has past. Use the shell found in the environment variable .Ev SHELL. .It Li at -c -m 1705 \&mo Execute at 5:05pm on Monday using .Xr csh 1 and send mail upon completion or termination of the job. .It Li at -s -m 1200n week Execute at noon one week from today, using .Xr sh 1 and send mail upon completetion. .It Li at -s 8a apr 1 Ideally this would be given late in March. The commands would be run at 8 am on April first, using the .Xr sh 1 . .El .Sh ERRORS Errors must be collected via the .Fl m option or by redirecting the standard output from inside the .Ar command_file. .Sh FILES .Bl -tag -width /var/spool/at/yy.ddd.hhhh.* -compact .It Pa /var/spool/at spooling area .It Pa /var/spool/at/yy.ddd.hhhh.* job file .It Pa /var/spool/at/past directory where jobs are executed from .It Pa /var/spool/at/lasttimedone last time atrun was run .It Pa /var/libexec/atrun executor (run by .Xr cron 8 ) .El .Sh SEE ALSO .Xr atq 1 , .Xr atrm 1 , .Xr calendar 1 , .Xr cron 8 .Xr sleep 1 , .Sh DIAGNOSTICS Complains about various syntax errors and times out of range. .Sh BUGS The queueing mechanism .Pa /usr/libexec/atrun , is scheduled by .Xr cron 8 . If it is run infrequently, a job may fall thru the cracks. .Pp There are known problems attempting to specify a time of 2400 hours to .Nm at . .Pp If the system crashes, mail is not sent to the user informing them that the job was not completed. .Pp Sometimes old spool files are not removed from the directory .Pa /var/spool/at/past . This is usually due to a system crash, and requires that they be removed by hand. .Sh HISTORY An .Nm command appeared in Version 7 AT&T UNIX.