683 lines
26 KiB
HTML
683 lines
26 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<meta name="generator" content="HTML Tidy, see www.w3.org">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 -->
|
|
<!-- Copyright (c) 2001 The Open Group, All Rights Reserved -->
|
|
<title>at</title>
|
|
</head>
|
|
<body bgcolor="white">
|
|
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
|
|
</script>
|
|
|
|
<basefont size="3"> <a name="at"></a> <a name="tag_04_05"></a><!-- at -->
|
|
<!--header start-->
|
|
<center><font size="2">The Open Group Base Specifications Issue 6<br>
|
|
IEEE Std 1003.1-2001<br>
|
|
Copyright © 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
|
|
|
|
<!--header end-->
|
|
<hr size="2" noshade>
|
|
<h4><a name="tag_04_05_01"></a>NAME</h4>
|
|
|
|
<blockquote>at - execute commands at a later time</blockquote>
|
|
|
|
<h4><a name="tag_04_05_02"></a>SYNOPSIS</h4>
|
|
|
|
<blockquote class="synopsis">
|
|
<div class="box"><code><tt><sup>[<a href="javascript:open_code('UP')">UP</a>]</sup> <img src="../images/opt-start.gif" alt=
|
|
"[Option Start]" border="0"> at</tt> <b>[</b><tt>-m</tt><b>][</b><tt>-f</tt> <i>file</i><b>][</b><tt>-q</tt>
|
|
<i>queuename</i><b>]</b> <tt>-t</tt> <i>time_arg</i><tt><br>
|
|
<br>
|
|
at</tt> <b>[</b><tt>-m</tt><b>][</b><tt>-f</tt> <i>file</i><b>][</b><tt>-q</tt> <i>queuename</i><b>]</b> <i>timespec</i>
|
|
<tt>...<br>
|
|
<br>
|
|
at -r</tt> <i>at_job_id</i> <tt>...<br>
|
|
<br>
|
|
at -l -q</tt> <i>queuename</i><tt><br>
|
|
<br>
|
|
at -l</tt> <b>[</b><i>at_job_id</i> <tt>...</tt><b>]</b><tt><img src="../images/opt-end.gif" alt="[Option End]" border=
|
|
"0"></tt></code></div>
|
|
|
|
<tt><br>
|
|
</tt></blockquote>
|
|
|
|
<h4><a name="tag_04_05_03"></a>DESCRIPTION</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>at</i> utility shall read commands from standard input and group them together as an <i>at-job</i>, to be executed at a
|
|
later time.</p>
|
|
|
|
<p>The at-job shall be executed in a separate invocation of the shell, running in a separate process group with no controlling
|
|
terminal, except that the environment variables, current working directory, file creation mask, and other implementation-defined
|
|
execution-time attributes in effect when the <i>at</i> utility is executed shall be retained and used when the at-job is
|
|
executed.</p>
|
|
|
|
<p>When the at-job is submitted, the <i>at_job_id</i> and scheduled time shall be written to standard error. The <i>at_job_id</i>
|
|
is an identifier that shall be a string consisting solely of alphanumeric characters and the period character. The <i>at_job_id</i>
|
|
shall be assigned by the system when the job is scheduled such that it uniquely identifies a particular job.</p>
|
|
|
|
<p>User notification and the processing of the job's standard output and standard error are described under the <b>-m</b>
|
|
option.</p>
|
|
|
|
<p><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
Users shall be permitted to use <i>at</i> if their name appears in the file <b>/usr/lib/cron/at.allow</b>. If that file does not
|
|
exist, the file <b>/usr/lib/cron/at.deny</b> shall be checked to determine whether the user shall be denied access to <i>at</i>. If
|
|
neither file exists, only a process with the appropriate privileges shall be allowed to submit a job. If only <b>at.deny</b> exists
|
|
and is empty, global usage shall be permitted. The <b>at.allow</b> and <b>at.deny</b> files shall consist of one user name per
|
|
line. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_05_04"></a>OPTIONS</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>at</i> utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, <a href=
|
|
"../basedefs/xbd_chap12.html#tag_12_02">Section 12.2, Utility Syntax Guidelines</a>.</p>
|
|
|
|
<p>The following options shall be supported:</p>
|
|
|
|
<dl compact>
|
|
<dt><b>-f </b> <i>file</i></dt>
|
|
|
|
<dd>Specify the pathname of a file to be used as the source of the at-job, instead of standard input.</dd>
|
|
|
|
<dt><b>-l</b></dt>
|
|
|
|
<dd>(The letter ell.) Report all jobs scheduled for the invoking user if no <i>at_job_id</i> operands are specified. If
|
|
<i>at_job_id</i>s are specified, report only information for these jobs. The output shall be written to standard output.</dd>
|
|
|
|
<dt><b>-m</b></dt>
|
|
|
|
<dd>Send mail to the invoking user after the at-job has run, announcing its completion. Standard output and standard error produced
|
|
by the at-job shall be mailed to the user as well, unless redirected elsewhere. Mail shall be sent even if the job produces no
|
|
output.
|
|
|
|
<p>If <b>-m</b> is not used, the job's standard output and standard error shall be provided to the user by means of mail, unless
|
|
they are redirected elsewhere; if there is no such output to provide, the implementation need not notify the user of the job's
|
|
completion.</p>
|
|
</dd>
|
|
|
|
<dt><b>-q </b> <i>queuename</i></dt>
|
|
|
|
<dd><br>
|
|
Specify in which queue to schedule a job for submission. When used with the <b>-l</b> option, limit the search to that particular
|
|
queue. By default, at-jobs shall be scheduled in queue <i>a</i>. In contrast, queue <i>b</i> shall be reserved for batch jobs; see
|
|
<a href="../utilities/batch.html"><i>batch</i></a>. The meanings of all other <i>queuename</i>s are implementation-defined. If
|
|
<b>-q</b> is specified along with either of the <b>-t</b> <i>time_arg</i> or <i>timespec</i> arguments, the results are
|
|
unspecified.</dd>
|
|
|
|
<dt><b>-r</b></dt>
|
|
|
|
<dd>Remove the jobs with the specified <i>at_job_id</i> operands that were previously scheduled by the <i>at</i> utility.</dd>
|
|
|
|
<dt><b>-t </b> <i>time_arg</i></dt>
|
|
|
|
<dd>Submit the job to be run at the time specified by the <i>time</i> option-argument, which the application shall ensure has the
|
|
format as specified by the <a href="../utilities/touch.html"><i>touch</i></a> <b>-t</b> <i>time</i> utility.</dd>
|
|
</dl>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_05_05"></a>OPERANDS</h4>
|
|
|
|
<blockquote>
|
|
<p>The following operands shall be supported:</p>
|
|
|
|
<dl compact>
|
|
<dt><i>at_job_id</i></dt>
|
|
|
|
<dd>The name reported by a previous invocation of the <i>at</i> utility at the time the job was scheduled.</dd>
|
|
|
|
<dt><i>timespec</i></dt>
|
|
|
|
<dd>Submit the job to be run at the date and time specified. All of the <i>timespec</i> operands are interpreted as if they were
|
|
separated by <space>s and concatenated, and shall be parsed as described in the grammar at the end of this section. The date
|
|
and time shall be interpreted as being in the timezone of the user (as determined by the <i>TZ</i> variable), unless a timezone
|
|
name appears as part of <i>time</i>, below.
|
|
|
|
<p>In the POSIX locale, the following describes the three parts of the time specification string. All of the values from the
|
|
<i>LC_TIME</i> categories in the POSIX locale shall be recognized in a case-insensitive manner.</p>
|
|
|
|
<dl compact>
|
|
<dt><i>time</i></dt>
|
|
|
|
<dd>The time can be specified as one, two, or four digits. One-digit and two-digit numbers shall be taken to be hours; four-digit
|
|
numbers to be hours and minutes. The time can alternatively be specified as two numbers separated by a colon, meaning
|
|
<i>hour</i>:<i>minute</i>. An AM/PM indication (one of the values from the <b>am_pm</b> keywords in the <i>LC_TIME</i> locale
|
|
category) can follow the time; otherwise, a 24-hour clock time shall be understood. A timezone name can also follow to further
|
|
qualify the time. The acceptable timezone names are implementation-defined, except that they shall be case-insensitive and the
|
|
string <b>utc</b> is supported to indicate the time is in Coordinated Universal Time. In the POSIX locale, the <i>time</i> field
|
|
can also be one of the following tokens:
|
|
|
|
<dl compact>
|
|
<dt><b>midnight</b></dt>
|
|
|
|
<dd>Indicates the time 12:00 am (00:00).</dd>
|
|
|
|
<dt><b>noon</b></dt>
|
|
|
|
<dd>Indicates the time 12:00 pm.</dd>
|
|
|
|
<dt><b>now</b></dt>
|
|
|
|
<dd>Indicates the current day and time. Invoking <i>at</i> <<b>now</b>> shall submit an at-job for potentially immediate
|
|
execution (that is, subject only to unspecified scheduling delays).</dd>
|
|
</dl>
|
|
</dd>
|
|
|
|
<dt><i>date</i></dt>
|
|
|
|
<dd>An optional <i>date</i> can be specified as either a month name (one of the values from the <b>mon</b> or <b>abmon</b> keywords
|
|
in the <i>LC_TIME</i> locale category) followed by a day number (and possibly year number preceded by a comma), or a day of the
|
|
week (one of the values from the <b>day</b> or <b>abday</b> keywords in the <i>LC_TIME</i> locale category). In the POSIX locale,
|
|
two special days shall be recognized:
|
|
|
|
<dl compact>
|
|
<dt><b>today</b></dt>
|
|
|
|
<dd>Indicates the current day.</dd>
|
|
|
|
<dt><b>tomorrow</b></dt>
|
|
|
|
<dd>Indicates the day following the current day.</dd>
|
|
</dl>
|
|
|
|
<p>If no <i>date</i> is given, <b>today</b> shall be assumed if the given time is greater than the current time, and
|
|
<b>tomorrow</b> shall be assumed if it is less. If the given month is less than the current month (and no year is given), next year
|
|
shall be assumed.</p>
|
|
</dd>
|
|
|
|
<dt><i>increment</i></dt>
|
|
|
|
<dd>The optional <i>increment</i> shall be a number preceded by a plus sign ( <tt>'+'</tt> ) and suffixed by one of the following:
|
|
<b>minutes</b>, <b>hours</b>, <b>days</b>, <b>weeks</b>, <b>months</b>, or <b>years</b>. (The singular forms shall also be
|
|
accepted.) The keyword <b>next</b> shall be equivalent to an increment number of +1. For example, the following are equivalent
|
|
commands:
|
|
|
|
<pre>
|
|
<tt>at 2pm + 1 week
|
|
at 2pm next week
|
|
</tt>
|
|
</pre>
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p>The following grammar describes the precise format of <i>timespec</i> in the POSIX locale. The general conventions for this
|
|
style of grammar are described in <a href="xcu_chap01.html#tag_01_10"><i>Grammar Conventions</i></a> . This formal syntax shall
|
|
take precedence over the preceding text syntax description. The longest possible token or delimiter shall be recognized at a given
|
|
point. When used in a <i>timespec</i>, white space shall also delimit tokens.</p>
|
|
|
|
<pre>
|
|
<tt>%token hr24clock_hr_min
|
|
%token hr24clock_hour
|
|
/*
|
|
An hr24clock_hr_min is a one, two, or four-digit number. A one-digit
|
|
or two-digit number constitutes an hr24clock_hour. An hr24clock_hour
|
|
may be any of the single digits [0,9], or may be double digits, ranging
|
|
from [00,23]. If an hr24clock_hr_min is a four-digit number, the
|
|
first two digits shall be a valid hr24clock_hour, while the last two
|
|
represent the number of minutes, from [00,59].
|
|
*/
|
|
<br>
|
|
%token wallclock_hr_min
|
|
%token wallclock_hour
|
|
/*
|
|
A wallclock_hr_min is a one, two-digit, or four-digit number.
|
|
A one-digit or two-digit number constitutes a wallclock_hour.
|
|
A wallclock_hour may be any of the single digits [1,9], or may
|
|
be double digits, ranging from [01,12]. If a wallclock_hr_min
|
|
is a four-digit number, the first two digits shall be a valid
|
|
wallclock_hour, while the last two represent the number of
|
|
minutes, from [00,59].
|
|
*/
|
|
<br>
|
|
%token minute
|
|
/*
|
|
A minute is a one or two-digit number whose value can be [0,9]
|
|
or [00,59].
|
|
*/
|
|
<br>
|
|
%token day_number
|
|
/*
|
|
A day_number is a number in the range appropriate for the particular
|
|
month and year specified by month_name and year_number, respectively.
|
|
If no year_number is given, the current year is assumed if the given
|
|
date and time are later this year. If no year_number is given and
|
|
the date and time have already occurred this year and the month is
|
|
not the current month, next year is the assumed year.
|
|
*/
|
|
<br>
|
|
%token year_number
|
|
/*
|
|
A year_number is a four-digit number representing the year A.D., in
|
|
which the at_job is to be run.
|
|
*/
|
|
<br>
|
|
%token inc_number
|
|
/*
|
|
The inc_number is the number of times the succeeding increment
|
|
period is to be added to the specified date and time.
|
|
*/
|
|
<br>
|
|
%token timezone_name
|
|
/*
|
|
The name of an optional timezone suffix to the time field, in an
|
|
implementation-defined format.
|
|
*/
|
|
<br>
|
|
%token month_name
|
|
/*
|
|
One of the values from the mon or abmon keywords in the LC_TIME
|
|
locale category.
|
|
*/
|
|
<br>
|
|
%token day_of_week
|
|
/*
|
|
One of the values from the day or abday keywords in the LC_TIME
|
|
locale category.
|
|
*/
|
|
<br>
|
|
%token am_pm
|
|
/*
|
|
One of the values from the am_pm keyword in the LC_TIME locale
|
|
category.
|
|
*/
|
|
<br>
|
|
%start timespec
|
|
%%
|
|
timespec : time
|
|
| time date
|
|
| time increment
|
|
| time date increment
|
|
| nowspec
|
|
;
|
|
<br>
|
|
nowspec : "now"
|
|
| "now" increment
|
|
;
|
|
<br>
|
|
time : hr24clock_hr_min
|
|
| hr24clock_hr_min timezone_name
|
|
| hr24clock_hour ":" minute
|
|
| hr24clock_hour ":" minute timezone_name
|
|
| wallclock_hr_min am_pm
|
|
| wallclock_hr_min am_pm timezone_name
|
|
| wallclock_hour ":" minute am_pm
|
|
| wallclock_hour ":" minute am_pm timezone_name
|
|
| "noon"
|
|
| "midnight"
|
|
;
|
|
<br>
|
|
date : month_name day_number
|
|
| month_name day_number "," year_number
|
|
| day_of_week
|
|
| "today"
|
|
| "tomorrow"
|
|
;
|
|
<br>
|
|
increment : "+" inc_number inc_period
|
|
| "next" inc_period
|
|
;
|
|
<br>
|
|
inc_period : "minute" | "minutes"
|
|
| "hour" | "hours"
|
|
| "day" | "days"
|
|
| "week" | "weeks"
|
|
| "month" | "months"
|
|
| "year" | "years"
|
|
;
|
|
</tt>
|
|
</pre>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_05_06"></a>STDIN</h4>
|
|
|
|
<blockquote>
|
|
<p>The standard input shall be a text file consisting of commands acceptable to the shell command language described in <a href=
|
|
"xcu_chap02.html#tag_02"><i>Shell Command Language</i></a> . The standard input shall only be used if no <b>-f</b> <i>file</i>
|
|
option is specified.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_05_07"></a>INPUT FILES</h4>
|
|
|
|
<blockquote>
|
|
<p>See the STDIN section.</p>
|
|
|
|
<p><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
The text files <b>/usr/lib/cron/at.allow</b> and <b>/usr/lib/cron/at.deny</b> shall contain zero or more user names, one per line,
|
|
of users who are, respectively, authorized or denied access to the <i>at</i> and <a href="../utilities/batch.html"><i>batch</i></a>
|
|
utilities. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_05_08"></a>ENVIRONMENT VARIABLES</h4>
|
|
|
|
<blockquote>
|
|
<p>The following environment variables shall affect the execution of <i>at</i>:</p>
|
|
|
|
<dl compact>
|
|
<dt><i>LANG</i></dt>
|
|
|
|
<dd>Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of
|
|
IEEE Std 1003.1-2001, <a href="../basedefs/xbd_chap08.html#tag_08_02">Section 8.2, Internationalization Variables</a> for
|
|
the precedence of internationalization variables used to determine the values of locale categories.)</dd>
|
|
|
|
<dt><i>LC_ALL</i></dt>
|
|
|
|
<dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd>
|
|
|
|
<dt><i>LC_CTYPE</i></dt>
|
|
|
|
<dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as
|
|
opposed to multi-byte characters in arguments and input files).</dd>
|
|
|
|
<dt><i>LC_MESSAGES</i></dt>
|
|
|
|
<dd>Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error and
|
|
informative messages written to standard output.</dd>
|
|
|
|
<dt><i>NLSPATH</i></dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
Determine the location of message catalogs for the processing of <i>LC_MESSAGES .</i> <img src="../images/opt-end.gif" alt=
|
|
"[Option End]" border="0"></dd>
|
|
|
|
<dt><i>LC_TIME</i></dt>
|
|
|
|
<dd>Determine the format and contents for date and time strings written and accepted by <i>at</i>.</dd>
|
|
|
|
<dt><i>SHELL</i></dt>
|
|
|
|
<dd>Determine a name of a command interpreter to be used to invoke the at-job. If the variable is unset or null, <a href=
|
|
"../utilities/sh.html"><i>sh</i></a> shall be used. If it is set to a value other than a name for <a href=
|
|
"../utilities/sh.html"><i>sh</i></a>, the implementation shall do one of the following: use that shell; use <a href=
|
|
"../utilities/sh.html"><i>sh</i></a>; use the login shell from the user database; or any of the preceding accompanied by a warning
|
|
diagnostic about which was chosen.</dd>
|
|
|
|
<dt><i>TZ</i></dt>
|
|
|
|
<dd>Determine the timezone. The job shall be submitted for execution at the time specified by <i>timespec</i> or <b>-t</b>
|
|
<i>time</i> relative to the timezone specified by the <i>TZ</i> variable. If <i>timespec</i> specifies a timezone, it shall
|
|
override <i>TZ .</i> If <i>timespec</i> does not specify a timezone and <i>TZ</i> is unset or null, an unspecified default timezone
|
|
shall be used.</dd>
|
|
</dl>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_05_09"></a>ASYNCHRONOUS EVENTS</h4>
|
|
|
|
<blockquote>
|
|
<p>Default.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_05_10"></a>STDOUT</h4>
|
|
|
|
<blockquote>
|
|
<p>When standard input is a terminal, prompts of unspecified format for each line of the user input described in the STDIN section
|
|
may be written to standard output.</p>
|
|
|
|
<p>In the POSIX locale, the following shall be written to the standard output for each job when jobs are listed in response to the
|
|
<b>-l</b> option:</p>
|
|
|
|
<pre>
|
|
<tt>"%s\t%s\n",</tt> <i>at_job_id</i><tt>, <</tt><i>date</i><tt>>
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>where <i>date</i> shall be equivalent in format to the output of:</p>
|
|
|
|
<pre>
|
|
<tt>date +"%a %b %e %T %Y"
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>The date and time written shall be adjusted so that they appear in the timezone of the user (as determined by the <i>TZ</i>
|
|
variable).</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_05_11"></a>STDERR</h4>
|
|
|
|
<blockquote>
|
|
<p>In the POSIX locale, the following shall be written to standard error when a job has been successfully submitted:</p>
|
|
|
|
<pre>
|
|
<tt>"job %s at %s\n",</tt> <i>at_job_id</i><tt>, <</tt><i>date</i><tt>>
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>where <i>date</i> has the same format as that described in the STDOUT section. Neither this, nor warning messages concerning the
|
|
selection of the command interpreter, shall be considered a diagnostic that changes the exit status.</p>
|
|
|
|
<p>Diagnostic messages, if any, shall be written to standard error.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_05_12"></a>OUTPUT FILES</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_05_13"></a>EXTENDED DESCRIPTION</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_05_14"></a>EXIT STATUS</h4>
|
|
|
|
<blockquote>
|
|
<p>The following exit values shall be returned:</p>
|
|
|
|
<dl compact>
|
|
<dt> 0</dt>
|
|
|
|
<dd>The <i>at</i> utility successfully submitted, removed, or listed a job or jobs.</dd>
|
|
|
|
<dt>>0</dt>
|
|
|
|
<dd>An error occurred.</dd>
|
|
</dl>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_05_15"></a>CONSEQUENCES OF ERRORS</h4>
|
|
|
|
<blockquote>
|
|
<p>The job shall not be scheduled, removed, or listed.</p>
|
|
</blockquote>
|
|
|
|
<hr>
|
|
<div class="box"><em>The following sections are informative.</em></div>
|
|
|
|
<h4><a name="tag_04_05_16"></a>APPLICATION USAGE</h4>
|
|
|
|
<blockquote>
|
|
<p>The format of the <i>at</i> command line shown here is guaranteed only for the POSIX locale. Other cultures may be supported
|
|
with substantially different interfaces, although implementations are encouraged to provide comparable levels of functionality.</p>
|
|
|
|
<p>Since the commands run in a separate shell invocation, running in a separate process group with no controlling terminal, open
|
|
file descriptors, traps, and priority inherited from the invoking environment are lost.</p>
|
|
|
|
<p>Some implementations do not allow substitution of different shells using <i>SHELL .</i> System V systems, for example, have used
|
|
the login shell value for the user in <b>/etc/passwd</b>. To select reliably another command interpreter, the user must include it
|
|
as part of the script, such as:</p>
|
|
|
|
<pre>
|
|
<b>$</b> <tt>at 1800
|
|
myshell myscript
|
|
EOT
|
|
</tt><b>job ... at ...
|
|
$</b>
|
|
</pre>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_05_17"></a>EXAMPLES</h4>
|
|
|
|
<blockquote>
|
|
<ol>
|
|
<li>
|
|
<p>This sequence can be used at a terminal:</p>
|
|
|
|
<pre>
|
|
<tt>at -m 0730 tomorrow
|
|
sort < file >outfile
|
|
EOT
|
|
</tt>
|
|
</pre>
|
|
</li>
|
|
|
|
<li>
|
|
<p>This sequence, which demonstrates redirecting standard error to a pipe, is useful in a command procedure (the sequence of output
|
|
redirection specifications is significant):</p>
|
|
|
|
<pre>
|
|
<tt>at now + 1 hour <<!
|
|
diff file1 file2 2>&1 >outfile | mailx mygroup
|
|
!
|
|
</tt>
|
|
</pre>
|
|
</li>
|
|
|
|
<li>
|
|
<p>To have a job reschedule itself, <i>at</i> can be invoked from within the at-job. For example, this daily processing script
|
|
named <b>my.daily</b> runs every day (although <a href="../utilities/crontab.html"><i>crontab</i></a> is a more appropriate vehicle
|
|
for such work):</p>
|
|
|
|
<pre>
|
|
<tt># my.daily runs every day
|
|
</tt><i>daily processing</i><tt>at now tomorrow < my.daily
|
|
</tt>
|
|
</pre>
|
|
</li>
|
|
|
|
<li>
|
|
<p>The spacing of the three portions of the POSIX locale <i>timespec</i> is quite flexible as long as there are no ambiguities.
|
|
Examples of various times and operand presentation include:</p>
|
|
|
|
<pre>
|
|
<tt>at 0815am Jan 24
|
|
at 8 :15amjan24
|
|
at now "+ 1day"
|
|
at 5 pm FRIday
|
|
at '17
|
|
utc+
|
|
30minutes'
|
|
</tt>
|
|
</pre>
|
|
</li>
|
|
</ol>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_05_18"></a>RATIONALE</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>at</i> utility reads from standard input the commands to be executed at a later time. It may be useful to redirect
|
|
standard output and standard error within the specified commands.</p>
|
|
|
|
<p>The <b>-t</b> <i>time</i> option was added as a new capability to support an internationalized way of specifying a time for
|
|
execution of the submitted job.</p>
|
|
|
|
<p>Early proposals added a "jobname" concept as a way of giving submitted jobs names that are meaningful to the user submitting
|
|
them. The historical, system-specified <i>at_job_id</i> gives no indication of what the job is. Upon further reflection, it was
|
|
decided that the benefit of this was not worth the change in historical interface. The <i>at</i> functionality is useful in simple
|
|
environments, but in large or complex situations, the functionality provided by the Batch Services option is more suitable.</p>
|
|
|
|
<p>The <b>-q</b> option historically has been an undocumented option, used mainly by the <a href=
|
|
"../utilities/batch.html"><i>batch</i></a> utility.</p>
|
|
|
|
<p>The System V <b>-m</b> option was added to provide a method for informing users that an at-job had completed. Otherwise, users
|
|
are only informed when output to standard error or standard output are not redirected.</p>
|
|
|
|
<p>The behavior of <i>at</i> <<b>now</b>> was changed in an early proposal from being unspecified to submitting a job for
|
|
potentially immediate execution. Historical BSD <i>at</i> implementations support this. Historical System V implementations give an
|
|
error in that case, but a change to the System V versions should have no backwards-compatibility ramifications.</p>
|
|
|
|
<p>On BSD-based systems, a <b>-u</b> <i>user</i> option has allowed those with appropriate privileges to access the work of other
|
|
users. Since this is primarily a system administration feature and is not universally implemented, it has been omitted. Similarly,
|
|
a specification for the output format for a user with appropriate privileges viewing the queues of other users has been
|
|
omitted.</p>
|
|
|
|
<p>The <b>-f</b> <i>file</i> option from System V is used instead of the BSD method of using the last operand as the pathname. The
|
|
BSD method is ambiguous-does:</p>
|
|
|
|
<pre>
|
|
<tt>at 1200 friday
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>mean the same thing if there is a file named <b>friday</b> in the current directory?</p>
|
|
|
|
<p>The <i>at_job_id</i> is composed of a limited character set in historical practice, and it is mandated here to invalidate
|
|
systems that might try using characters that require shell quoting or that could not be easily parsed by shell scripts.</p>
|
|
|
|
<p>The <i>at</i> utility varies between System V and BSD systems in the way timezones are used. On System V systems, the <i>TZ</i>
|
|
variable affects the at-job submission times and the times displayed for the user. On BSD systems, <i>TZ</i> is not taken into
|
|
account. The BSD behavior is easily achieved with the current specification. If the user wishes to have the timezone default to
|
|
that of the system, they merely need to issue the <i>at</i> command immediately following an unsetting or null assignment to <i>TZ
|
|
.</i> For example:</p>
|
|
|
|
<pre>
|
|
<tt>TZ= at noon ...
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>gives the desired BSD result.</p>
|
|
|
|
<p>While the <a href="../utilities/yacc.html"><i>yacc</i></a>-like grammar specified in the OPERANDS section is lexically
|
|
unambiguous with respect to the digit strings, a lexical analyzer would probably be written to look for and return digit strings in
|
|
those cases. The parser could then check whether the digit string returned is a valid <i>day_number</i>, <i>year_number</i>, and so
|
|
on, based on the context.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_05_19"></a>FUTURE DIRECTIONS</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_05_20"></a>SEE ALSO</h4>
|
|
|
|
<blockquote>
|
|
<p><a href="batch.html"><i>batch</i></a> , <a href="crontab.html"><i>crontab</i></a></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_05_21"></a>CHANGE HISTORY</h4>
|
|
|
|
<blockquote>
|
|
<p>First released in Issue 2.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_05_22"></a>Issue 6</h4>
|
|
|
|
<blockquote>
|
|
<p>This utility is marked as part of the User Portability Utilities option.</p>
|
|
|
|
<p>The following new requirements on POSIX implementations derive from alignment with the Single UNIX Specification:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>If <b>-m</b> is not used, the job's standard output and standard error are provided to the user by mail.</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>The effects of using the <b>-q</b> and <b>-t</b> options as defined in the IEEE P1003.2b draft standard are specified.</p>
|
|
|
|
<p>The normative text is reworded to avoid use of the term "must" for application requirements.</p>
|
|
</blockquote>
|
|
|
|
<div class="box"><em>End of informative text.</em></div>
|
|
|
|
<hr>
|
|
<hr size="2" noshade>
|
|
<center><font size="2"><!--footer start-->
|
|
UNIX ® is a registered Trademark of The Open Group.<br>
|
|
POSIX ® is a registered Trademark of The IEEE.<br>
|
|
[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
|
|
"../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>
|
|
]</font></center>
|
|
|
|
<!--footer end-->
|
|
<hr size="2" noshade>
|
|
</body>
|
|
</html>
|
|
|