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

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       batch - schedule commands to be executed in a batch queue
13

SYNOPSIS

15        batch
16

DESCRIPTION

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

OPTIONS

40       None.
41

OPERANDS

43       None.
44

STDIN

46       The standard input shall be a text file consisting of commands  accept‐
47       able  to the shell command language described in Shell Command Language
48       .
49

INPUT FILES

51       The text files /usr/lib/cron/at.allow and  /usr/lib/cron/at.deny  shall
52       contain  zero  or  more  user  names,  one  per line, of users who are,
53       respectively, authorized or denied access to the at  and  batch  utili‐
54       ties.
55

ENVIRONMENT VARIABLES

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

ASYNCHRONOUS EVENTS

103       Default.
104

STDOUT

106       When  standard  input  is a terminal, prompts of unspecified format for
107       each line of the user input described in the STDIN section may be writ‐
108       ten to standard output.
109

STDERR

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

OUTPUT FILES

132       None.
133

EXTENDED DESCRIPTION

135       None.
136

EXIT STATUS

138       The following exit values shall be returned:
139
140        0     Successful completion.
141
142       >0     An error occurred.
143
144

CONSEQUENCES OF ERRORS

146       The job shall not be scheduled.
147
148       The following sections are informative.
149

APPLICATION USAGE

151       It  may be useful to redirect standard output within the specified com‐
152       mands.
153

EXAMPLES

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

RATIONALE

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

FUTURE DIRECTIONS

187       None.
188

SEE ALSO

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