8815 mega_sas: variable set but not used
[unleashed.git] / usr / src / man / man1 / at.1
blob1936d144ef2220843add9b71897adb6868809006
1 '\" te
2 .\" Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
3 .\" Copyright 1989 AT&T
4 .\" Portions Copyright (c) 2005, Sun Microsystems, Inc.  All Rights Reserved
5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
6 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
8 .\"  This notice shall appear on any product containing this material.
9 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
10 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
11 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
12 .TH AT 1 "Apr 13, 2005"
13 .SH NAME
14 at, batch \- execute commands at a later time
15 .SH SYNOPSIS
16 .LP
17 .nf
18 \fB/usr/bin/at\fR [\fB-c\fR | \fB-k\fR | \fB-s\fR] [\fB-m\fR] [\fB-f\fR \fIfile\fR] [\fB-p\fR \fIproject\fR]
19      [\fB-q\fR \fIqueuename\fR] \fB-t\fR \fItime\fR
20 .fi
22 .LP
23 .nf
24 \fB/usr/bin/at\fR [\fB-c\fR | \fB-k\fR | \fB-s\fR] [\fB-m\fR] [\fB-f\fR \fIfile\fR] [\fB-p\fR \fIproject\fR]
25      [\fB-q\fR \fIqueuename\fR] \fItimespec\fR...
26 .fi
28 .LP
29 .nf
30 \fB/usr/bin/at\fR \fB-l\fR [\fB-p\fR \fIproject\fR] [\fB-q\fR \fIqueuename\fR] [\fIat_job_id\fR \fI...\fR]
31 .fi
33 .LP
34 .nf
35 \fB/usr/bin/at\fR \fB-r\fR \fIat_job_id\fR \fI...\fR
36 .fi
38 .LP
39 .nf
40 \fB/usr/bin/batch\fR [\fB-p\fR \fIproject\fR]
41 .fi
43 .LP
44 .nf
45 \fB/usr/xpg4/bin/at\fR [\fB-c\fR | \fB-k\fR | \fB-s\fR] [\fB-m\fR] [\fB-f\fR \fIfile\fR] [\fB-p\fR \fIproject\fR]
46      [\fB-q\fR \fIqueuename\fR] \fB-t\fR \fItime\fR
47 .fi
49 .LP
50 .nf
51 \fB/usr/xpg4/bin/at\fR [\fB-c\fR | \fB-k\fR | \fB-s\fR] [\fB-m\fR] [\fB-f\fR \fIfile\fR] [\fB-p\fR \fIproject\fR]
52      [\fB-q\fR \fIqueuename\fR] \fItimespec\fR...
53 .fi
55 .LP
56 .nf
57 \fB/usr/xpg4/bin/at\fR \fB-l\fR [\fB-p\fR \fIproject\fR] [\fB-q\fR \fIqueuename\fR]
58      [\fIat_job_id\fR \fI...\fR]
59 .fi
61 .LP
62 .nf
63 \fB/usr/xpg4/bin/at\fR \fB-r\fR \fIat_job_id\fR \fI...\fR
64 .fi
66 .LP
67 .nf
68 \fB/usr/xpg4/bin/batch\fR [\fB-p\fR \fIproject\fR]
69 .fi
71 .SH DESCRIPTION
72 .SS "at"
73 .sp
74 .LP
75 The \fBat\fR utility reads commands from standard input and groups them
76 together as an \fIat-job\fR, to be executed at a later time.
77 .sp
78 .LP
79 The at-job is executed in a separate invocation of the shell, running in a
80 separate process group with no controlling terminal, except that the
81 environment variables, current working directory, file creation mask (see
82 \fBumask\fR(1)), and system resource limits (for \fBsh\fR and \fBksh\fR only,
83 see \fBulimit\fR(1)) in effect when the \fBat\fR utility is executed is
84 retained and used when the at-job is executed.
85 .sp
86 .LP
87 When the at-job is submitted, the \fIat_job_id\fR and scheduled time are
88 written to standard error. The \fIat_job_id\fR is an identifier that is a
89 string consisting solely of alphanumeric characters and the period character.
90 The \fIat_job_id\fR is assigned by the system when the job is scheduled such
91 that it uniquely identifies a particular job.
92 .sp
93 .LP
94 User notification and the processing of the job's standard output and standard
95 error are described under the \fB-m\fR option.
96 .sp
97 .LP
98 Users are permitted to use \fBat\fR and \fBbatch\fR (see below) if their name
99 appears in the file \fB/usr/lib/cron/at.allow\fR. If that file does not exist,
100 the file \fB/usr/lib/cron/at.deny\fR is checked to determine if the user should
101 be denied access to \fBat\fR. If neither file exists, only a user with the
102 \fBsolaris.jobs.user\fR authorization is allowed to submit a job. If only
103 \fBat.deny\fR exists and is empty, global usage is permitted. The
104 \fBat.allow\fR and \fBat.deny\fR files consist of one user name per line.
107 \fBcron\fR and \fBat\fR jobs are not be executed if the user's account is
108 locked. Only accounts which are not locked as defined in \fBshadow\fR(4) will
109 have their job or process executed.
110 .SS "batch"
113 The \fBbatch\fR utility reads commands to be executed at a later time.
116 Commands of the forms:
118 .in +2
120 /usr/bin/batch [-p project]
121 /usr/xpg4/bin/batch [-p project]
123 .in -2
128 are respectively equivalent to:
130 .in +2
132 /usr/bin/at -q b [-p project] now
133 /usr/xpg4/bin/at -q b -m [-p project] now
135 .in -2
140 where queue \fBb\fR is a special \fBat\fR queue, specifically for batch jobs.
141 Batch jobs are submitted to the batch queue for immediate execution. Execution
142 of submitted jobs can be delayed by limits on the number of jobs allowed to run
143 concurrently. See \fBqueuedefs\fR(4).
144 .SH OPTIONS
147 If the \fB-c\fR, \fB-k\fR, or \fB-s\fR options are not specified, the
148 \fBSHELL\fR environment variable by default determines which shell to use.
151 If \fBSHELL\fR is unset or \fBNULL\fR, \fB/usr/bin/sh\fR is used.
154 The following options are supported:
156 .ne 2
158 \fB\fB-c\fR \fR
160 .RS 17n
161 C shell. \fBcsh\fR(1) is used to execute the at-job.
165 .ne 2
167 \fB\fB-k\fR \fR
169 .RS 17n
170 Korn shell. \fBksh\fR(1) is used to execute the at-job.
174 .ne 2
176 \fB\fB-s\fR \fR
178 .RS 17n
179 Bourne shell. \fBsh\fR(1) is used to execute the at-job.
183 .ne 2
185 \fB\fB-f\fR \fIfile\fR \fR
187 .RS 17n
188 Specifies the path of a file to be used as the source of the at-job, instead of
189 standard input.
193 .ne 2
195 \fB\fB-l\fR \fR
197 .RS 17n
198 (The letter ell.) Reports all jobs scheduled for the invoking user if no
199 \fIat_job_id\fR operands are specified. If \fIat_job_id\fRs are specified,
200 reports only information for these jobs.
204 .ne 2
206 \fB\fB-m\fR \fR
208 .RS 17n
209 Sends mail to the invoking user after the at-job has run, announcing its
210 completion. Standard output and standard error produced by the at-job are
211 mailed to the user as well, unless redirected elsewhere. Mail is sent even if
212 the job produces no output.
214 If \fB-m\fR is not used, the job's standard output and standard error is
215 provided to the user by means of mail, unless they are redirected elsewhere; if
216 there is no such output to provide, the user is not notified of the job's
217 completion.
221 .ne 2
223 \fB\fB-p\fR \fIproject\fR\fR
225 .RS 17n
226 Specifies under which project the \fBat\fR or \fBbatch\fR job is run. When used
227 with the \fB-l\fR option, limits the search to that particular project. Values
228 for \fIproject\fR is interpreted first as a project name, and then as a
229 possible project \fBID\fR, if entirely numeric. By default, the user's current
230 project is used.
234 .ne 2
236 \fB\fB-q\fR \fIqueuename\fR \fR
238 .RS 17n
239 Specifies in which queue to schedule a job for submission. When used with the
240 \fB-l\fR option, limits the search to that particular queue. Values for
241 \fIqueuename\fR are limited to the lower case letters \fBa\fR through \fBz\fR.
242 By default, at-jobs are scheduled in queue \fBa\fR. In contrast, queue \fBb\fR
243 is reserved for batch jobs. Since queue \fBc\fR is reserved for cron jobs, it
244 can not be used with the \fB-q\fR option.
248 .ne 2
250 \fB\fB-r\fR \fIat_job_id\fR \fR
252 .RS 17n
253 Removes the jobs with the specified \fIat_job_id\fR operands that were
254 previously scheduled by the \fBat\fR utility.
258 .ne 2
260 \fB\fB-t\fR \fItime\fR \fR
262 .RS 17n
263 Submits the job to be run at the time specified by the \fItime\fR
264 option-argument, which must have the format as specified by the \fBtouch\fR(1)
265 utility.
268 .SH OPERANDS
271 The following operands are supported:
273 .ne 2
275 \fB\fIat_job_id\fR \fR
277 .RS 14n
278 The name reported by a previous invocation of the \fBat\fR utility at the time
279 the job was scheduled.
283 .ne 2
285 \fB\fItimespec\fR \fR
287 .RS 14n
288 Submit the job to be run at the date and time specified. All of the
289 \fItimespec\fR operands are interpreted as if they were separated by space
290 characters and concatenated. The date and time are interpreted as being in the
291 timezone of the user (as determined by the \fBTZ\fR variable), unless a
292 timezone name appears as part of \fItime\fR below.
294 In the "C" locale, the following describes the three parts of the time
295 specification string. All of the values from the \fBLC_TIME\fR categories in
296 the "C" locale are recognized in a case-insensitive manner.
298 .ne 2
300 \fB\fItime\fR \fR
302 .RS 14n
303 The \fItime\fR can be specified as one, two or four digits. One- and two-digit
304 numbers are taken to be hours, four-digit numbers to be hours and minutes. The
305 time can alternatively be specified as two numbers separated by a colon,
306 meaning \fIhour\fR\fB:\fR\fIminute\fR. An AM/PM indication (one of the values
307 from the \fBam_pm\fR keywords in the \fBLC_TIME\fR locale category) can follow
308 the time; otherwise, a 24-hour clock time is understood. A timezone name of
309 \fBGMT\fR, \fBUCT\fR, or \fBZULU \fR(case insensitive) can follow to specify
310 that the time is in Coordinated Universal Time.  Other timezones can be
311 specified using the \fBTZ\fR environment variable. The \fItime\fR field can
312 also be one of the following tokens in the "C" locale:
314 .ne 2
316 \fB\fBmidnight\fR \fR
318 .RS 13n
319 Indicates the time 12:00 am (00:00).
323 .ne 2
325 \fB\fBnoon\fR \fR
327 .RS 13n
328 Indicates the time 12:00 pm.
332 .ne 2
334 \fB\fBnow\fR \fR
336 .RS 13n
337 Indicate the current day and time. Invoking \fBat\fR \fBnow\fR submits an
338 at-job for potentially immediate execution (that is, subject only to
339 unspecified scheduling delays).
345 .ne 2
347 \fB\fIdate\fR \fR
349 .RS 14n
350 An optional \fIdate\fR can be specified as either a month name (one of the
351 values from the \fBmon\fR or \fBabmon\fR keywords in the \fBLC_TIME\fR locale
352 category) followed by a day number (and possibly year number preceded by a
353 comma) or a day of the week (one of the values from the \fBday\fR or
354 \fBabday\fR keywords in the \fBLC_TIME\fR locale category). Two special days
355 are recognized in the "C" locale:
357 .ne 2
359 \fB\fBtoday\fR \fR
361 .RS 13n
362 Indicates the current day.
366 .ne 2
368 \fB\fBtomorrow\fR \fR
370 .RS 13n
371 Indicates the day following the current day.
374 If no \fIdate\fR is given, \fBtoday\fR is assumed if the given time is greater
375 than the current time, and \fBtomorrow\fR is assumed if it is less. If the
376 given month is less than the current month (and no year is given), next year is
377 assumed.
381 .ne 2
383 \fB\fIincrement\fR \fR
385 .RS 14n
386 The optional \fIincrement\fR is a number preceded by a plus sign (\fB+\fR) and
387 suffixed by one of the following: \fBminutes\fR, \fBhours\fR, \fBdays\fR,
388 \fBweeks\fR, \fBmonths\fR, or \fByears\fR. (The singular forms are also
389 accepted.) The keyword \fBnext\fR is equivalent to an increment number of \fB+
390 1\fR. For example, the following are equivalent commands:
392 .in +2
394 \fBat 2pm + 1 week
395 at 2pm next week\fR
397 .in -2
404 .SH USAGE
407 The format of the \fBat\fR command line shown here is guaranteed only for the
408 "C" locale. Other locales are not supported for \fBmidnight\fR, \fBnoon\fR,
409 \fBnow\fR, \fBmon\fR, \fBabmon\fR, \fBday\fR, \fBabday\fR, \fBtoday\fR,
410 \fBtomorrow\fR, \fBminutes\fR, \fBhours\fR, \fBdays\fR, \fBweeks\fR,
411 \fBmonths\fR, \fByears\fR, and \fBnext\fR.
414 Since the commands run in a separate shell invocation, running in a separate
415 process group with no controlling terminal, open file descriptors, traps and
416 priority inherited from the invoking environment are lost.
417 .SH EXAMPLES
418 .SS "at"
420 \fBExample 1 \fRTypical Sequence at a Terminal
423 This sequence can be used at a terminal:
426 .in +2
428 $ at \(mim 0730 tomorrow
429 sort < file >outfile
430 <EOT>
432 .in -2
436 \fBExample 2 \fRRedirecting Output
439 This sequence, which demonstrates redirecting standard error to a pipe, is
440 useful in a command procedure (the sequence of output redirection
441 specifications is significant):
444 .in +2
446 $ at now + 1 hour <<!
447 diff file1 file2 2>&1 >outfile | mailx mygroup
449 .in -2
453 \fBExample 3 \fRSelf-rescheduling a Job
456 To have a job reschedule itself, \fBat\fR can be invoked from within the
457 at-job. For example, this "daily-processing" script named \fBmy.daily\fR runs
458 every day (although \fBcrontab\fR is a more appropriate vehicle for such work):
461 .in +2
463 # my.daily runs every day
464 at now tomorrow < my.daily
465 daily-processing
467 .in -2
471 \fBExample 4 \fRVarious Time and Operand Presentations
474 The spacing of the three portions of the "C" locale \fItimespec\fR is quite
475 flexible as long as there are no ambiguities. Examples of various times and
476 operand presentations include:
479 .in +2
481 at 0815am Jan 24
482 at 8 :15amjan24
483 at now "+ 1day"
484 at 5 pm FRIday
485 at '17
486         utc+
487         30minutes'
489 .in -2
492 .SS "batch"
494 \fBExample 5 \fRTypical Sequence at a Terminal
497 This sequence can be used at a terminal:
500 .in +2
502 $ batch
503 sort <file >outfile
504 <EOT>
506 .in -2
510 \fBExample 6 \fRRedirecting Output
513 This sequence, which demonstrates redirecting standard error to a pipe, is
514 useful in a command procedure (the sequence of output redirection
515 specifications is significant):
518 .in +2
520 $ batch <<!
521 diff file1 file2 2>&1 >outfile | mailx mygroup
524 .in -2
527 .SH ENVIRONMENT VARIABLES
530 See \fBenviron\fR(5) for descriptions of the following environment variables
531 that affect the execution of \fBat\fR and \fBbatch\fR: \fBLANG\fR,
532 \fBLC_ALL\fR, \fBLC_CTYPE\fR,  \fBLC_MESSAGES\fR,  \fBNLSPATH\fR, and
533 \fBLC_TIME\fR.
535 .ne 2
537 \fB\fBDATEMSK\fR \fR
539 .RS 12n
540 If the environment variable \fBDATEMSK\fR is set, \fBat\fR uses its value as
541 the full path name of a template file containing format strings. The strings
542 consist of format specifiers and text characters that are used to provide a
543 richer set of allowable date formats in different languages by appropriate
544 settings of the environment variable \fBLANG\fR or \fBLC_TIME\fR. The list of
545 allowable format specifiers is located in the \fBgetdate\fR(3C) manual page.
546 The formats described in the \fBOPERANDS\fR section for the \fItime\fR and
547 \fIdate\fR arguments, the special names \fBnoon\fR, \fBmidnight\fR, \fBnow\fR,
548 \fBnext\fR, \fBtoday\fR, \fBtomorrow\fR, and the \fIincrement\fR argument are
549 not recognized when \fBDATEMSK\fR is set.
553 .ne 2
555 \fB\fBSHELL\fR \fR
557 .RS 12n
558 Determine a name of a command interpreter to be used to invoke the at-job. If
559 the variable is unset or \fINULL\fR, \fBsh\fR is used. If it is set to a value
560 other than \fBsh\fR, the implementation uses that shell; a warning diagnostic
561 is printed telling which shell will be used.
565 .ne 2
567 \fB\fBTZ\fR \fR
569 .RS 12n
570 Determine the timezone. The job is submitted for execution at the time
571 specified by \fItimespec\fR or \fB-t\fR \fItime\fR relative to the timezone
572 specified by the \fBTZ\fR variable. If \fItimespec\fR specifies a timezone, it
573 overrides \fBTZ\fR. If \fItimespec\fR does not specify a timezone and \fBTZ\fR
574 is unset or \fINULL\fR, an unspecified default timezone is used.
577 .SH EXIT STATUS
580 The following exit values are returned:
582 .ne 2
584 \fB\fB0\fR \fR
586 .RS 7n
587 The \fBat\fR utility successfully submitted, removed or listed a job or jobs.
591 .ne 2
593 \fB\fB>0\fR \fR
595 .RS 7n
596 An error occurred, and the job will not be scheduled.
599 .SH FILES
601 .ne 2
603 \fB\fB/usr/lib/cron/at.allow\fR \fR
605 .RS 27n
606 names of users, one per line, who are authorized access to the \fBat\fR and
607 \fBbatch\fR utilities
611 .ne 2
613 \fB\fB/usr/lib/cron/at.deny\fR \fR
615 .RS 27n
616 names of users, one per line, who are denied access to the \fBat\fR and
617 \fBbatch\fR utilities
620 .SH ATTRIBUTES
623 See \fBattributes\fR(5) for descriptions of the following attributes:
624 .SS "/usr/bin/at"
629 box;
630 c | c
631 l | l .
632 ATTRIBUTE TYPE  ATTRIBUTE VALUE
634 CSI     Not enabled
636 Interface Stability     Standard
639 .SS "/usr/xpg4/bin/at"
644 box;
645 c | c
646 l | l .
647 ATTRIBUTE TYPE  ATTRIBUTE VALUE
649 CSI     Not enabled
651 Interface Stability     Standard
654 .SS "/usr/bin/batch"
659 box;
660 c | c
661 l | l .
662 ATTRIBUTE TYPE  ATTRIBUTE VALUE
664 CSI     Enabled
666 Interface Stability     Standard
669 .SS "/usr/xpg4/bin/batch"
674 box;
675 c | c
676 l | l .
677 ATTRIBUTE TYPE  ATTRIBUTE VALUE
679 CSI     Enabled
681 Interface Stability     Standard
684 .SH SEE ALSO
687 \fBauths\fR(1), \fBcrontab\fR(1), \fBcsh\fR(1), \fBdate\fR(1), \fBksh\fR(1),
688 \fBsh\fR(1), \fBtouch\fR(1), \fBulimit\fR(1), \fBumask\fR(1), \fBcron\fR(1M),
689 \fBgetdate\fR(3C), \fBauth_attr\fR(4), \fBshadow\fR(4), \fBqueuedefs\fR(4),
690 \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5)
691 .SH NOTES
694 Regardless of queue used, \fBcron\fR(1M) has a limit of 100 jobs in execution
695 at any time.
698 There can be delays in \fBcron\fR at job execution. In some cases, these delays
699 can compound to the point that \fBcron\fR job processing appears to be hung.
700 All jobs are executed eventually. When the delays are excessive, the only
701 workaround is to kill and restart \fBcron\fR.