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
11

NAME

13       batch — schedule commands to be executed in a batch queue
14

SYNOPSIS

16       batch
17

DESCRIPTION

19       The batch utility shall read commands from standard input and  schedule
20       them  for execution in a batch queue. It shall be the equivalent of the
21       command:
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       at.allow which is located in an implementation-defined  directory.   If
32       that  file  does  not  exist,  the file at.deny, which is located in an
33       implementation-defined directory, shall be checked to determine whether
34       the user shall be denied access to batch.  If neither file exists, only
35       a process with appropriate privileges shall be allowed to submit a job.
36       If  only  at.deny exists and is empty, global usage shall be permitted.
37       The at.allow and at.deny files shall consist of one user name per 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 Chapter 2, Shell Com‐
48       mand Language.
49

INPUT FILES

51       The text files at.allow and at.deny, which are located in an  implemen‐
52       tation-defined  directory,  shall  contain zero or more user names, one
53       per line, of users who are, respectively, authorized or  denied  access
54       to the at and batch utilities.
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  vari‐
61                 ables  that are unset or null. (See the Base Definitions vol‐
62                 ume of POSIX.1‐2008, Section 8.2, Internationalization  Vari‐
63                 ables  for  the  precedence of internationalization variables
64                 used to determine the values of locale categories.)
65
66       LC_ALL    If set to a non-empty string value, override  the  values  of
67                 all the other internationalization variables.
68
69       LC_CTYPE  Determine  the  locale for the interpretation of sequences of
70                 bytes of text data as characters (for example, single-byte as
71                 opposed  to  multi-byte  characters  in  arguments  and input
72                 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   Determine the format and contents for date and  time  strings
80                 written by batch.
81
82       NLSPATH   Determine the location of message catalogs for the processing
83                 of LC_MESSAGES.
84
85       SHELL     Determine the name of a command interpreter  to  be  used  to
86                 invoke the at-job. If the variable is unset or null, sh shall
87                 be used. If it is set to a value other than a  name  for  sh,
88                 the  implementation  shall  do one of the following: use that
89                 shell; use sh; use the login shell from  the  user  database;
90                 any  of  the  preceding  accompanied  by a warning diagnostic
91                 about which was chosen.
92
93       TZ        Determine the timezone. The job shall be submitted for execu‐
94                 tion at the time specified by timespec or −t time relative to
95                 the timezone specified by the TZ variable. If timespec speci‐
96                 fies a timezone, it overrides TZ.  If timespec does not spec‐
97                 ify a timezone and  TZ  is  unset  or  null,  an  unspecified
98                 default timezone shall be used.
99

ASYNCHRONOUS EVENTS

101       Default.
102

STDOUT

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

STDERR

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

OUTPUT FILES

128       None.
129

EXTENDED DESCRIPTION

131       None.
132

EXIT STATUS

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

CONSEQUENCES OF ERRORS

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

APPLICATION USAGE

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

EXAMPLES

150        1. This sequence can be used at a terminal:
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               batch <<!
161               diff file1 file2 2>&1 >outfile | mailx mygroup
162               !
163

RATIONALE

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

FUTURE DIRECTIONS

180       None.
181

SEE ALSO

183       at
184
185       The Base Definitions volume of  POSIX.1‐2008,  Chapter  8,  Environment
186       Variables
187
189       Portions  of  this text are reprinted and reproduced in electronic form
190       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
191       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
192       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
193       cal  and  Electronics  Engineers,  Inc  and  The  Open Group.  (This is
194       POSIX.1-2008 with the 2013 Technical Corrigendum  1  applied.)  In  the
195       event of any discrepancy between this version and the original IEEE and
196       The Open Group Standard, the original IEEE and The Open Group  Standard
197       is  the  referee document. The original Standard can be obtained online
198       at http://www.unix.org/online.html .
199
200       Any typographical or formatting errors that appear  in  this  page  are
201       most likely to have been introduced during the conversion of the source
202       files to man page format. To report such errors,  see  https://www.ker
203       nel.org/doc/man-pages/reporting_bugs.html .
204
205
206
207IEEE/The Open Group                  2013                            BATCH(1P)
Impressum