[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 1


batch Command

Purpose

Runs jobs when the system load level permits.

Syntax

batch

Description

The batch command reads from standard input the names of commands to be run at a later time and runs the jobs when the system load level permits. The batch command mails you all output from standard output and standard error for the scheduled commands, unless you redirect that output. It also writes the job number and the scheduled time to standard error.

When the batch command is executed, it retains variables in the shell environment, and the current directory; however, it does not retain open file descriptors, traps, and priority.

The batch command is equivalent to entering the at -q b -m now command. The -q b flag specifies the at queue for batch jobs.

Exit Status

This command returns the following exit values:

0 Successful completion
>0 An error occurred.

Examples

To run a job when the system load permits, enter:

batch <<!
longjob
!

This example shows the use of a "Here Document" to send standard input to the batch command.

Files


/usr/bin/batch Contains the batch command.
/bin/batch Symbolic link to the batch command.
/var/adm/cron Indicates the main cron daemon directory.
/var/spool/cron/atjobs Indicates the spool area.

Related Information

at command, bsh command, csh command, kill command, ksh command, mail command, nice command, ps command.

Daemons: cron.

Input and Output Redirection Overview in AIX 5L Version 5.1 System User's Guide: Operating System and Devices describes how the operating system processes input and output.

Korn Shell Special Commands and Bourne Shell Special Commands in AIX 5L Version 5.1 System User's Guide: Operating System and Devices.

National Language Support Overview for Programming in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs explains collating sequences, equivalence classes, and locale.

Shells Overview in AIX 5L Version 5.1 System User's Guide: Operating System and Devices describes what shells are, the different types of shells, and how shells affect the way commands are interpreted.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]