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

OUTPUT FILES

130       None.
131

EXTENDED DESCRIPTION

133       None.
134

EXIT STATUS

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

CONSEQUENCES OF ERRORS

143       The job shall not be scheduled.
144
145       The following sections are informative.
146

APPLICATION USAGE

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

EXAMPLES

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

RATIONALE

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

FUTURE DIRECTIONS

184       None.
185

SEE ALSO

187       at
188
189       The Base Definitions volume of  POSIX.1‐2017,  Chapter  8,  Environment
190       Variables
191
193       Portions  of  this text are reprinted and reproduced in electronic form
194       from IEEE Std 1003.1-2017, Standard for Information Technology --  Por‐
195       table  Operating System Interface (POSIX), The Open Group Base Specifi‐
196       cations Issue 7, 2018 Edition, Copyright (C) 2018 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       Any  typographical  or  formatting  errors that appear in this page are
204       most likely to have been introduced during the conversion of the source
205       files  to  man page format. To report such errors, see https://www.ker
206       nel.org/doc/man-pages/reporting_bugs.html .
207
208
209
210IEEE/The Open Group                  2017                            BATCH(1P)
Impressum