1BATCH(P)                   POSIX Programmer's Manual                  BATCH(P)
2
3
4

NAME

6       batch - schedule commands to be executed in a batch queue
7

SYNOPSIS

9        batch
10

DESCRIPTION

12       The  batch utility shall read commands from standard input and schedule
13       them for execution in a batch queue. It shall be the equivalent of  the
14       command:
15
16
17              at -q b -m now
18
19       where queue b is a special at queue, specifically for batch jobs. Batch
20       jobs shall be submitted to the batch queue with no time constraints and
21       shall  be run by the system using algorithms, based on unspecified fac‐
22       tors, that may vary with each invocation of batch.
23
24       Users shall be permitted to use batch if their name appears in the file
25       /usr/lib/cron/at.allow.   If   that  file  does  not  exist,  the  file
26       /usr/lib/cron/at.deny shall be checked to determine  whether  the  user
27       shall  be  denied  access  to  batch.   If  neither file exists, only a
28       process with the appropriate privileges shall be allowed  to  submit  a
29       job. If only at.deny exists and is empty, global usage shall be permit‐
30       ted. The at.allow and at.deny files shall consist of one user name  per
31       line.
32

OPTIONS

34       None.
35

OPERANDS

37       None.
38

STDIN

40       The  standard input shall be a text file consisting of commands accept‐
41       able to the shell command language described in Shell Command  Language
42       .
43

INPUT FILES

45       The  text  files /usr/lib/cron/at.allow and /usr/lib/cron/at.deny shall
46       contain zero or more user names,  one  per  line,  of  users  who  are,
47       respectively,  authorized  or  denied access to the at and batch utili‐
48       ties.
49

ENVIRONMENT VARIABLES

51       The following environment  variables  shall  affect  the  execution  of
52       batch:
53
54       LANG   Provide  a  default value for the internationalization variables
55              that are unset or null. (See  the  Base  Definitions  volume  of
56              IEEE Std 1003.1-2001,  Section  8.2,  Internationalization Vari‐
57              ables for the precedence of internationalization variables  used
58              to determine the values of locale categories.)
59
60       LC_ALL If  set  to a non-empty string value, override the values of all
61              the other internationalization variables.
62
63       LC_CTYPE
64              Determine the locale for  the  interpretation  of  sequences  of
65              bytes  of  text  data as characters (for example, single-byte as
66              opposed to multi-byte characters in arguments and input files).
67
68       LC_MESSAGES
69              Determine the locale that should be used to  affect  the  format
70              and  contents  of  diagnostic messages written to standard error
71              and informative messages written to standard output.
72
73       LC_TIME
74              Determine the format and contents  for  date  and  time  strings
75              written by batch.
76
77       NLSPATH
78              Determine the location of message catalogs for the processing of
79              LC_MESSAGES .
80
81       SHELL  Determine the name of a command interpreter to be used to invoke
82              the  at-job. If the variable is unset or null, sh shall be used.
83              If it is set to a value other than a name for sh, the  implemen‐
84              tation  shall  do  one of the following: use that shell; use sh;
85              use the login shell from the user database; any of the preceding
86              accompanied by a warning diagnostic about which was chosen.
87
88       TZ     Determine the timezone. The job shall be submitted for execution
89              at the time specified by timespec or -t  time  relative  to  the
90              timezone  specified by the TZ variable.  If timespec specifies a
91              timezone, it overrides TZ . If timespec does not specify a time‐
92              zone  and  TZ  is unset or null, an unspecified default timezone
93              shall be used.
94
95

ASYNCHRONOUS EVENTS

97       Default.
98

STDOUT

100       When standard input is a terminal, prompts of  unspecified  format  for
101       each line of the user input described in the STDIN section may be writ‐
102       ten to standard output.
103

STDERR

105       The following shall be written to standard error when a  job  has  been
106       successfully submitted:
107
108
109              "job %s at %s\n", at_job_id, <date>
110
111       where date shall be equivalent in format to the output of:
112
113
114              date +"%a %b %e %T %Y"
115
116       The  date and time written shall be adjusted so that they appear in the
117       timezone of the user (as determined by the TZ variable).
118
119       Neither this, nor warning messages concerning the selection of the com‐
120       mand  interpreter,  are  considered  a diagnostic that changes the exit
121       status.
122
123       Diagnostic messages, if any, shall be written to standard error.
124

OUTPUT FILES

126       None.
127

EXTENDED DESCRIPTION

129       None.
130

EXIT STATUS

132       The following exit values shall be returned:
133
134        0     Successful completion.
135
136       >0     An error occurred.
137
138

CONSEQUENCES OF ERRORS

140       The job shall not be scheduled.
141
142       The following sections are informative.
143

APPLICATION USAGE

145       It may be useful to redirect standard output within the specified  com‐
146       mands.
147

EXAMPLES

149        1. This sequence can be used at a terminal:
150
151
152           batch
153           sort < file >outfile
154           EOT
155
156        2. This  sequence,  which demonstrates redirecting standard error to a
157           pipe, is useful in a command procedure (the sequence of output  re‐
158           direction specifications is significant):
159
160
161           batch <<
162           ! diff file1 file2 2>&1 >outfile | mailx mygroup
163           !
164

RATIONALE

166       Early  proposals described batch in a manner totally separated from at,
167       even though the historical model treated it almost as a synonym for  at
168       -qb.  A  number  of  features were added to list and control batch work
169       separately from those in at. Upon further reflection,  it  was  decided
170       that  the  benefit  of  this did not merit the change to the historical
171       interface.
172
173       The -m option was included on the equivalent at command because  it  is
174       historical  practice to mail results to the submitter, even if all job-
175       produced output is redirected. As explained in the  RATIONALE  for  at,
176       the now keyword submits the job for immediate execution (after schedul‐
177       ing delays), despite some historical systems where at  now  would  have
178       been considered an error.
179

FUTURE DIRECTIONS

181       None.
182

SEE ALSO

184       at
185
187       Portions  of  this text are reprinted and reproduced in electronic form
188       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
189       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
190       Specifications Issue 6, Copyright (C) 2001-2003  by  the  Institute  of
191       Electrical  and  Electronics  Engineers, Inc and The Open Group. In the
192       event of any discrepancy between this version and the original IEEE and
193       The  Open Group Standard, the original IEEE and The Open Group Standard
194       is the referee document. The original Standard can be  obtained  online
195       at http://www.opengroup.org/unix/online.html .
196
197
198
199IEEE/The Open Group                  2003                             BATCH(P)
Impressum