Вы находитесь на странице: 1из 39

Intergraph Batch Services for Windows NT

Quick-Start Guide
May 2000 DSA070841

Warranties and Liabilities The information and the software discussed in this document are subject to change without notice and should not be considered commitments by Intergraph Corporation. Intergraph Corporation assumes no responsibility for any errors in this document. The software discussed in this document is furnished under a license and may be used or copied only in accordance with the terms of the license. No responsibility is assumed by Intergraph for the use or reliability of software on equipment that is not supplied by Intergraph or its affiliated companies. All warranties given by Intergraph Corporation about equipment or software are set forth in your purchase contract, and nothing stated in, or implied by, this document or its contents shall be considered or deemed a modification or amendment of such warranties. Trademarks Intergraph and the Intergraph logo are registered trademarks of Intergraph Corporation. Microsoft is a registered trademark of Microsoft Corporation. Windows NT and the Windows NT logo are trademarks of Microsoft Corporation. Other brands and product names are trademarks of their respective owners. Copyright 1998-2000 Intergraph Corporation, including this documentation, and any software and its file formats and audiovisual displays described herein; all rights reserved; may only be used pursuant to the applicable software license agreement; contains confidential and proprietary information of Intergraph and/or other third parties which is protected by copyright, trade secret and trademark law and may not be provided or otherwise made available without prior written authorization. Restricted Rights Legend Use, duplication, or disclosure by the United States Government is subject to restrictions as set forth in subdivision (c)(1)(ii) of the rights in technical data and computer software clause at DFARS 252.227-7013. Unpublished -- rights reserved under the copyright laws of the United States. Intergraph Corporation Huntsville AL 35894-0001

iii

Contents
Contents ............................................................................................................................................................... iii Preface................................................................................................................................................................... 1 About This Document ................................................................................................................................... 1 Finding Additional Batch Services Information ............................................................................................ 1 Finding Operating System Information ......................................................................................................... 2 Getting Documentation and Training ............................................................................................................ 2 Getting Telephone Support............................................................................................................................ 2 Finding Intergraph on the Internet ................................................................................................................. 2 1. Batch Services Overview ................................................................................................................................ 2 1.1 Batch Services Defined ........................................................................................................................... 2 1.2 Batch Services Features........................................................................................................................... 2 1.3 Batch Services Components .................................................................................................................... 3 1.4 Getting Started......................................................................................................................................... 4 2. Installing and Configuring Batch Services ................................................................................................... 6 2.1 Before Installing Batch Services ............................................................................................................. 6 2.2 Installing Batch Services ......................................................................................................................... 6 2.3 Starting and Stopping Batch Services...................................................................................................... 8 2.4 Configuring Batch Services Desktop Access........................................................................................... 8 2.5 Removing Batch Services........................................................................................................................ 9 3. Using Batch Manager ................................................................................................................................... 10 3.1 Understanding the Batch Manager Interface ......................................................................................... 10 3.2 Granting Batch Service Privileges......................................................................................................... 11 3.3 Understanding Account Mapping.......................................................................................................... 12 4. Creating and Managing Queues .................................................................................................................. 14 4.1 Creating and Deleting Queues ............................................................................................................... 14 4.2 Changing Queue Properties ................................................................................................................... 16 4.3 Setting the Default Queue...................................................................................................................... 17 4.4 Adding Shells to a Batch Queue ............................................................................................................ 17 4.5 Adding Destinations to a Pipe Queue .................................................................................................... 18 4.6 Enabling and Disabling a Queue ........................................................................................................... 18 4.7 Starting and Stopping a Queue .............................................................................................................. 19 4.8 Displaying Queue Status........................................................................................................................ 20 5. Submitting a Batch Job ................................................................................................................................ 22 5.1 Creating a Script .................................................................................................................................... 22 5.2 Submitting a Job .................................................................................................................................... 23 5.3 Saving and Restoring Named Batch Jobs .............................................................................................. 26 Glossary .............................................................................................................................................................. 28 Index.................................................................................................................................................................... 30

Preface
The Intergraph Batch Services for Windows NT Quick-Start Guide describes how to install, configure, and use Intergraph Batch Services on a computer running the Microsoft Windows NT operating system.

About This Document


This document is organized as follows: The Preface introduces you to the Quick-Start Guide, describes document conventions, and provides information on related documentation, product support, and contacting Intergraph. Chapter 1, Batch Services Overview, provides an introduction to the basic concepts and features of Intergraph Batch Services for Windows NT. Chapter 2, Installing and Configuring Batch Services, describes how to install, configure, and run Batch Services on your system. Chapter 3, Using Batch Manager, describes the Batch Manager graphical interface, and describes how to use it to grant batch service privileges for your system, and handle account mapping. Chapter 4, Creating and Managing Queues, describes how to use the Batch Manager graphical interface to create, manage, and monitor queues. Chapter 5, Submitting a Batch Job, describes how to use the Batch Manager graphical interface to submit a batch job. The Glossary defines terms used in this document.

This document assumes that you understand basic networking concepts, and that you have a working familiarity with the Transmission Control Protocol/Internet Protocol (TCP/IP), Internet addressing, and Windows NT services.

Finding Additional Batch Services Information


Additional Intergraph Batch Services documentation is available online through Batch Services Help (BATCHMGR.HLP), which is delivered when you install the Batch Services software. Batch Services Help provides detailed information on the following subjects: Batch Services terminology. Accomplishing tasks with Batch Services. Using the graphical user and command-line interfaces to Batch Services. Using the Batch Services application programming interface (API).

Finding Operating System Information


If you need more detailed information on an aspect of the Windows NT operating system, you can refer to the documentation delivered with the Windows NT operating system software.

Getting Documentation and Training


You can purchase additional system or software documentation from Intergraph. In the United States, contact your sales account representative, or call the Intergraph at 1-800-766-7701. At international locations, contact the Intergraph subsidiary or distributor from which you purchased your Intergraph system or software to place an order.

To find information on training for Intergraph systems and products, or to enroll for an available class, contact Intergraph Education Services at 1-800-766-7701. Detailed information on Intergraph documentation and training is also available on Intergraph Online, Intergraphs World Wide Web Server. See Finding Intergraph on the Internet for more information.

Getting Telephone Support


If you experience problems with your Intergraph system or software, or have questions about the information in this document, you can contact Intergraph for help. In the United States, call the Customer Response Center at 1-800-766-7701. At international locations, contact the Intergraph subsidiary or distributor from which you purchased your Intergraph system or software.

Have the following information readily available when you call: The products serial number. For software, you can find this on the license agreement. Your name and telephone number. The products name. A brief description of the problem.

Finding Intergraph on the Internet


You can find Intergraph on the Internet at www.intergraph.com.

1. Batch Services Overview


This chapter introduces you to the basic concepts and features of Intergraph Batch Services for the Microsoft Windows NT operating system.

1.1 Batch Services Defined


Batch Services is a Windows NT system service that allows you (or an application) to manage and perform noninteractive tasks on your computer system. Batch Services gives users and applications a means of submitting compute-intensive tasks as processes that will run in the background (non-interactively), and provides notification when the tasks complete. To perform tasks using Batch Services, you submit a batch job to the system running Batch Services (the batch server). The batch job provides information to the batch server about the tasks you want to accomplish and how you want the batch job to run. When a job is successfully submitted, it gets a unique job ID, enters a queue (a waiting list for processing), and then runs on the batch server system as if you were logged in to the system and executing the task yourself. Batch Services is useful to both system administrators and users. Delayed execution of tasks allows maintenance- and compute-intensive tasks, such as system data backups or compilation of large programs, to be scheduled for times when the system is not in use. Batch Services also allows several client machines to use a multiprocessor server as a compute engine for compute-intensive tasks. A large task can be spread out among several batch server systems available on the network.

1.2 Batch Services Features


With Batch Services, time-consuming, resource-consuming, and repetitive tasks can be run automatically. By making these tasks execute automatically, you can spend your time and resources on other tasks. Benefits of automating tasks with Batch Services include the following: You can submit compute-intensive jobs into the background, and then go on to other tasks or exit the application or session, while the batch job continues to process. You can set up jobs to repeatedly execute at any interval you choose. You can set up a list of jobs to run in a specific order. You can set the times you want your jobs to run. You can specify that certain jobs have priority over other jobs awaiting execution. You can submit jobs directly to a remote queue if Batch Services is present on that system.

3 Batch Services can continue processing tasks even after a system interruption. Batch Services manages the tasks so that you do not have to restart them yourself, providing the following features: Batch Services resubmits jobs when the network is down, or the remote host is unavailable. Batch Services automatically restarts jobs if the system crashes while a job is running, or if the system is down when a job is scheduled to run.

With Batch Services, you control the processing of tasks submitted as batch jobs. The following features allow you to manage task processing: You can use Batch Manager, a graphical user interface (GUI) for managing batch jobs. You can manage batch and pipe queues on remote nodes from one location. You can determine which jobs run at a given time, and in what order. You do not have to monitor jobs. Batch Services supports SMTP mail or event log notification when a batch job completes successfully or encounters errors.

Batch Services provides the following additional features: An application programming interface (API). Support for multiprocessor systems. A command-line interface that can be used with scripts. Job submission to or from Windows NT systems. Job submission to or from systems running Intergraphs Network Queuing System (NQS) when UNIX interoperability is required.

1.3 Batch Services Components


Batch Services software consists of the following components: A batch server program (BATSERV.EXE). Windows NT Batch Provider and Intergraph NQS Batch Provider dynamic-link libraries (DLLs), including an API library (BATCHAPI.DLL). An NQS listener program (NQS_SERV.EXE), to allow access to and from Intergraph NQS systems. The Batch Manager graphical interface (BATCHMGR.EXE). A command-line interface (QSUB.EXE, QSTAT.EXE, QMGR.EXE, QDEL.EXE).

1.4 Getting Started


Begin by following the instructions in Chapter 2 to install and configure the Batch Services software on your system. Then refer to the rest of the document as follows: To remove Batch Services software from your system, go to Chapter 2. To start or stop Batch Services, go to Chapter 2. To learn about the Batch Manager interface, go to Chapter 3. To grant batch services privileges on your system, go to Chapter 3. To create queues on your system, go to Chapter 4. To manage and monitor queues on your system, go to Chapter 4. To learn about scripts, go to Chapter 5. To submit a batch job, go to Chapter 5. To manage batch jobs, go to Chapter 5.

2. Installing and Configuring Batch Services


This chapter describes how to install and configure Batch Services on a system running the Windows NT operating system.

2.1 Before Installing Batch Services


Before installing Batch Services software, ensure that the system on which you want to use the software has the following: Intel-compatible 486 or higher processor At least 16 MB of RAM. 32 MB is recommended. At least 3.5 MB of free space on the systems hard disk. A Windows NT-compatible network adapter. Microsoft Windows NT operating system software version 3.5.1 or 4.0. If your site configuration includes Intergraph NQS machines, Windows NT-compatible TCP/IP service software is required. TCP/IP service software is delivered with Windows NT software, but is not installed by default with the operating system software. Install, configure, and start the TCP/IP service, preferably with Domain Name System (DNS) support enabled, before installing Batch Services. Refer to your Windows NT documentation for more information about TCP/IP and DNS.

NOTE

Batch Services software can work with any network adapter supported by Windows NT. Such adapters include Ethernet and Token Ring boards although other types of adapters may also be compatible. The network adapter you use must be properly installed and configured for your computer before you install Batch Services software. Refer to your Windows NT documentation for a list of compatible network adapters, and to the documentation for your network adapter for installation and configuration instructions.

2.2 Installing Batch Services


Intergraph uses the Setup program as the standard method for installing software products on a system running the Windows NT operating system. To install the software: 1. 2. Start your system with the Windows NT operating system. If your site configuration uses Intergraph NQS, verify that TCP/IP service is running on your system. Otherwise, proceed to step 3. Open Services in Control Panel to view the current status of TCP/IP service on your system, and start it if it is not already running.

7 3. 4. Insert the Batch Services CD-ROM into the CD-ROM drive. To start Setup, do one of the following: 5. 6. From the Start menu, select Run; then key the following into the Open box, where drive is the drive letter for the CD-ROM drive: drive:\setup In Windows NT Explorer, select the CD-ROM drive; then double-click on SETUP.EXE.

Follow the instructions displayed as Setup installs the Batch Services software. During installation, take note of the following: When prompted for user information, type your name and the products serial number (available from the software license agreement). Company name is optional. Setup verifies the serial number before installation continues. If the serial number is incorrect, the product will not install. Keep a record of the products serial number in case you need to re-install the product later.

CAUTION

When prompted for a path to the destination directory for product files, type a new path, or leave the default path as displayed. If the destination directory contains a version of the product you are installing, warning messages display. You may install the new version of the product over the currently installed version, or install the new version in another directory. During Setup, Batch Services displays the Account Mapping dialog, allowing you to configure account mapping. If you select Yes to configure account mapping, Setup displays the User Name dialog. Otherwise, Setup warns you that you must configure account mapping before you can submit jobs, and you may use the Batch Manager graphical interface (BATCHMGR.EXE) to configure account mapping after Setup is complete.

NOTE

NOTE

7. 8. 9.

Select whether or not you want to configure account mapping at this time. If you select Yes, proceed to the next step; otherwise, skip to step 11. Type in the username you want to configure (the default username is Guest). Type the password for the username into the Password and Confirm Password fields.

10. Select Continue, or select Cancel to set up account mapping after installation is complete. 11. Select whether you want jobs to have access to the desktop. If you allow jobs to have access to the desktop, an iconified and non-active window will appear on the screen when a job is runs. These windows will only appear when a user is logged on to the system. If your site is one where batch jobs might require some user input, you should select Yes. If your site is one where security is a major concern, you should select No; a logged-on user will be able to interact with running batch jobs, even if the job is running as a different user. NOTE You can change whether you want jobs to have access to the desktop later. See 2.4, Configuring Batch Services Desktop Access, for details. Jobs that try to access the desktop will not run unless the user running the job is a member of the Administrators group.

12. After Setup completes, reboot your system to restart Windows NT and start Batch Services.

2.3 Starting and Stopping Batch Services


When you install Batch Services software, the batch server is configured to start automatically each time you restart your system. No further configuration is required. Intergraph recommends leaving the batch server as configured. However, if you want to configure Batch Services to be started manually instead of automatically, take the following steps: 1. 2. 3. 4. Open Control Panel; then open Services. In Services, select Intergraph Batch Server from the Service list; then select Startup. In Service, under Startup Type, select Manual; then select OK. Close Services; then close Control Panel. Batch Services also delivers an NQS Listener service that is configured to start automatically. If your site is not using Intergraph NQS, you can configure the NQS Listener service to be started manually. Repeat steps 1-4, selecting NQS Listener from the Service list.

NOTE

If you configure Batch Services to be started manually, you must start the batch server each time you restart your system, or each time you want to run Batch Services. Take the following steps to start Batch Services manually: 1. 2. 3. Open Control Panel; then open Services. In Services, select Intergraph Batch Server from the Service list; then select Start. After the batch server starts, close Services; then close Control Panel.

Take the following steps to stop Batch Services: 1. 2. 3. 4. Open Control Panel; then open Services. In Services, select Intergraph Batch Server from the Service list; then select Stop. When prompted, confirm that you want to stop Batch Services. After the batch server stops, close Services; then close Control Panel.

2.4 Configuring Batch Services Desktop Access


When you install Batch Services software, you can select whether jobs have access to the desktop. If you want to change the desktop access function, take the following steps: 1. 2. 3. Open Control Panel; then open Services. In Services, select Intergraph Batch Server from the Service list; then select Startup. In Service, under Log On As, ensure that the Allow Service to Interact with Desktop checkbox is checked if you want jobs to have access to the desktop. If you do not want jobs to have access to the desktop, ensure that the checkbox is cleared. Select OK.

9 4. 5. You must stop and restart Batch Services to make the changes take effect. Select Stop; answer Yes; then select Start. Close Services; then close Control Panel.

2.5 Removing Batch Services


If you want to remove Batch Services from your system, click Start > Programs > Intergraph Batch Services > Remove Intergraph Batch Services.

10

3. Using Batch Manager


This chapter briefly describes the Intergraph Batch Manager graphical interface and how to use it to grant batch service privileges on your system. This chapter also briefly describes how Batch Services handles account mapping. For more detailed information on the Batch Manager interface, or for information on using the command-line interface, refer to Batch Services Help (BATCHMGR.HLP).

3.1 Understanding the Batch Manager Interface


Intergraph Batch Manager provides a graphical interface for viewing and managing batch services. Batch Manager allows you to create queues and connect to remote queues, and to submit and manipulate jobs within queues. Connection to remote servers allows you to manage other Windows NT batch servers on the network. Click Start > Programs > Intergraph Batch Services > Intergraph Batch Manager.

Figure 3-1. Batch Manager The Batch Manager toolbar, located below the Batch Manager menus, provides shortcuts to the following tasks. Position the cursor over a toolbar button to display a tip describing the command associated with that button. Buttons are provided for the following tasks: Submitting and deleting jobs Holding and releasing jobs Creating and deleting queues Enabling and disabling queues Starting and stopping queues

Batch Manager provides two types of views in the main window:

11 The server view displays information about the server and its queues. Information on each queue in the server view includes its name and type, its priority, its inflow and outflow state, and the number of jobs currently in the queue. When the server view is active, you can create, delete, and manage queues. Doubleclicking on a queue listed in a server view displays the queue view of that queue. The queue view displays information about the jobs contained in a specific queue. Information on each job in a queue includes its ID and status, its priority, its name, and the username of the jobs submitter. When the queue view is active, you can manipulate specific jobs in that queue. Double-clicking on a job listed in a queue view displays the properties of that job.

You can have multiple server and queue views active in the main window, and can tile or cascade the views to fit them into the main window. In Figure 3-1, a server view is shown in the main window. The status bar, at the bottom of the main window, displays information about the active view. For an active server view, the status bar displays the server name. For an active queue view, the status bar displays the queues name and type, its description, and its inflow and outflow states.

3.2 Granting Batch Service Privileges


Before you begin using Batch Services, you should use Batch Manager to ensure that users on your system (and users on other systems if appropriate) are granted the proper privileges for access to Batch Services. A user with manager privileges can use all the commands that affect batch server configuration and operation, including granting and removing privileges, and creating and deleting queues. A user with operator privileges can manage jobs, including those belonging to other users, and can start and stop batch server queues. Users or groups without privileges can only submit requests to queues to which they have been granted access; most users or user groups are non-privileged users. By default, the Administrators group on your system has manager privileges. From an account belonging to the Administrators group, you can add users and groups of users, on your system or other systems, to the manager and operator privilege lists. 1. 2. Open Batch Manager. Click Server > Properties. Select the Security tab. Users and groups, and their Batch Service privileges, display in the Managers and Operators list.

Figure 3-2. Server Properties Dialog: Security Page

12 4. Select Add; then key into the Add Names box the username of a user, or the group name of a group, to which you want to grant privileges. Specify local users and groups (on your system) by username or group name only. Use one of the following formats when keying in a username or group name: Users on Windows NT systems Groups on Windows NT systems domain_name\username or system_name\username domain_name\group_name or system_name\group_name

Separate multiple users or groups with a semicolon (;). 5. 6. 7. 8. Select the type of privilege you want to grant the user or group (manager or operator). Select OK. Repeat steps 4 through 6 for each user or group to which you want to grant privileges. When you have finished assigning privileges to users or groups, select OK.

To remove privileges from a user or group, take the following steps: 1. 2. 3. 4. 5. 6. 7. Open Batch Manager. Click Server > Properties. Select the Security tab. The Security page displays, shown in Figure 3-2. The current users and groups with Batch Service privileges are displayed in the Managers and Operators list. In the Managers and Operators list, select the user or group from which you want to remove privileges. Select Remove. Repeat steps 4 and 5 for each user or group from which you wish to remove privileges. When you have finished removing privileges from users and groups, select OK.

To change a users or groups privileges, first remove the current privileges from the user or group; then add the user or group to the privilege list with the new privilege.

3.3 Understanding Account Mapping


Batch Services requires an account name and password to use when running jobs. The process of determining the account name to use is called account mapping. You can use Batch Manager to enter and modify accountmapping information for your system. An account mapping entry comprises two parts: the user information to match (the from user), and whom that user maps to (the to user). Account mapping entries allow users submitting a job to assume the environment and permissions of the user to whom they are mapped. To perform account mapping, the server tries to match the job owner with an account mapping entry, using the following order (items are listed on the account mapping dialog in the order in which they are applied): 1. The server first tries to find an exact match, matching the job owners domain or machine name and username with the from user in the account mapping entries.

13 2. 3. 4. If the server cannot find an exact match, the server then searches the account mapping entries using the job owners domain or machine name, with * (meaning any user) as the username. If no match is found, the server then searches the account mapping entries using * (meaning any machine or domain) as the domain name, with the job owners username. Finally, if a match still has not been found, the server searches with * as the domain name and * as the username.

How you configure account mapping depends on the security needs and configuration of your site. Refer to the Batch Services Help (BATCHMGR.HLP) for complete instructions on configuring account mapping.

14

4. Creating and Managing Queues


This chapter describes how to use the Intergraph Batch Manager graphical interface to create and manage queues on a system running Batch Services for Windows NT. For more information on the Batch Manager interface, or for information on using the command-line interface, refer to Batch Services Help (BATCHMGR.HLP).

4.1 Creating and Deleting Queues


Before you can submit a batch job, you must create and enable a batch queue. The batch queue accepts requests to execute shell scripts, commands, or executables non-interactively. You may also want to create one or more pipe queues on your system. A pipe queue accepts requests to send batch jobs to another queue. Typically, you create a pipe queue when you need access to a batch queue on another system, such as a queue on an Intergraph NQS server. Note the following limitations on creating queues: You must have manager privileges to create a queue. When naming a queue, you can use any alphanumeric and punctuation characters, except for the punctuation characters [@ \ ( ) = ,]. The first character cannot be - or /. You cannot create a queue on an Intergraph NQS server from a Windows NT batch server, or create a queue on a Windows NT batch server from an Intergraph NQS server. However, you can remotely create queues on other Windows NT systems.

4.1.1 Creating a Batch Queue


To create a batch queue on your system, take the following steps: 1. 2. 3. 4. 5. 6. 7. Open Batch Manager. Select the server on which you wish to create the queue. Select Create from the Queue menu, or select the Create Queue button Key the queue name into the Queue Name box. Optionally, key a description of the batch queue into the Description box. Under Queue Type, select Batch. Select OK. from the toolbar.

Refer to 4.4, Adding Shells to a Batch Queue, for more information on batch queues.

15

4.1.2 Creating a Pipe Queue


To create a pipe queue on your system, take the following steps: 1. 2. 3. 4. 5. 6. 7. Open Batch Manager. Select the server on which you wish to create the queue. Select Create from the Queue menu, or select the Create Queue button Key the queue name into the Queue Name box. Optionally, key a description of the batch queue into the Description box. Under Queue Type, select Pipe. Select OK. from the toolbar.

Refer to 4.5, Adding Destinations to a Pipe Queue, for more information about pipe queues.

4.1.3 Deleting a Queue


Before you can delete a queue, the queue may not contain any jobs and must be disabled and stopped. You must have manager privileges to delete a queue. You can delete queues on remote Windows NT machines. You cannot delete an Intergraph NQS queue from a Windows NT machine. To delete a queue from your system, take the following steps: 1. 2. 3. 4. Open Batch Manager. Click on the queue listed in the server view, or select the queue view for that queue. Select Delete from the Queue menu, or select Delete Queue from the toolbar.

When prompted, Select Yes to confirm that you want to delete the queue.

16

4.2 Changing Queue Properties


A queue is created with its operational parameters set at default values. You can change these default values by selecting a queue listed in the server view and pressing ALT+ENTER, or by selecting the queue view for that queue, and then selecting Properties from the Queue menu. Select the tabs in the Queue Properties dialog to display the current values for a queues parameters. The following are basic operational parameters found in the Queue Properties dialog, along with their default values and brief descriptions of changes you can make. Tab General Scheduling Parameter Description Run Limit Default None 1 Comments Optional. Determines the maximum number of jobs that can run in the queue at the same time. Specify a number of jobs from 1 to 60. Determines the default priority of execution of a job relative to other jobs in the queue. Raise (as high as 1023) to increase the priority; lower (as low as 1024) to lower the priority. Determines who can gain access to the queue. To restrict access to specific users or groups of users, select Restricted. To open access to the queue to all users, select Unrestricted. Lists users or groups of users that can gain access to the queue if it is restricted. Select Add to add users or groups to the access list. Select a user or group, and then select Remove, to remove that user or group from the access list. When keying in a username or group name, use the format for usernames and group names described in 3.2, Granting Batch Service Privileges. Shells Destinations For a complete description, see 4.4, Adding Shells to a Batch Queue. Order dependent. For a complete description, see 4.5, Adding Destinations to a Pipe Queue.

Job Defaults

Scheduling Priority

31

Security

Queue Access

Unrestricted

Authorized Groups and Users

None

17

4.3 Setting the Default Queue


You may want to specify the default queue for your system. The default queue is the one to which batch jobs are submitted when a user does not explicitly request a queue. The default queue must be a queue that exists on your system. To set the default queue, take the following steps: 1. 2. 3. 4. Open Batch Manager. Select Properties from the Server menu. The Server Properties dialog displays. Key a queue name into the Default Queue box, or select one from the Default Queue drop-down list. Selecting (NONE) indicates no default queue selection. Select OK.

You must have manager privileges on the batch server to set the default queue.

4.4 Adding Shells to a Batch Queue


A shell is a program that can run a specific type of script; for example, CMD.EXE is a shell that can run .BAT scripts. You can associate a list of shells with each batch queue. The shell list allows you to specify a shell from the list without knowing where the actual shell resides on the machine. NOTE When you associate a list of shells with a batch queue, users can choose one of these shells from the list, specify a full path to another shell, or use a shell in the PATH environment variable for the user to whom the job is mapped.

To add a shell to a batch queue, take the following steps: 1. 2. 3. 4. 5. 6. Open Batch Manager. Click on the batch queue listed in the server view, or select the queue view for that queue. Select Properties from the Queue menu. The Queue Properties dialog displays. Select the Shells tab. Under Shell Configuration, key the name of the shell into the Name box; then key the path to the shell into the Location box. Select Add. The name and location of the shell display in the Shell box. If you wish to set a default shell for the queue, proceed to the next step. Otherwise, skip to step 8. You may want to specify the default shell for a batch queue on your system. The default shell is the one run when a user submits a job, but does not explicitly request a shell. When you set a default shell for a batch queue, you must explicitly select another shell if you want to submit a job to run a script that uses another shell. If you wish to submit executable programs (.EXE files) to a batch queue, do not set a default shell for that queue, or set the default shell to be CMD.EXE.

NOTE

7.

Select the shell in the Shell List box; then select Default. The name of the shell displays in the Default Shell box.

18 8. Select OK.

You must have manager privileges on the batch server to set the default shell for a batch queue.

4.5 Adding Destinations to a Pipe Queue


Destinations are used with pipe queues. Pipe queues are normally used to create a connection to a remote batch queue. A pipe queue interprets a batch job request, and pipes it to the first available queue in its destination list that will accept the request. The destination list may contain any queue type. To add a destination to a pipe queue, take the following steps: 1. 2. 3. 4. 5. Open Batch Manager. Click on the pipe queue listed in the server view, or select the queue view for that queue. Select Properties from the Queue menu. The Queue Properties dialog displays. Select the Destinations tab. Key the new destination queue into the Destination edit box; then select Add. The destination displays in the List box.

A destination can be a local queue (on your system) or a remote queue (on other systems). Specify a local queue by its queue name. To specify a remote queue, use one of the following formats when keying in the remote queue name: Queues on Windows NT systems \\system_name\queue_name Queues on Intergraph NQS systems queue_name@system_name NOTE 6. 7. If you list more than one destination for a pipe queue, the pipe queue will send a job to the first available queue in its destination list that will accept the job.

Repeat step 5 for each destination you want to add to the pipe queue. When you have finished adding destinations to the pipe queue, select OK.

You must have manager privileges on the batch server to add a destination to a pipe queue.

4.6 Enabling and Disabling a Queue


A newly created queue has a disabled inflow state; it will not accept new jobs that are submitted or transferred to it. A queue must be enabled to accept new jobs. To enable a queue, take the following steps: 1. 2. 3. Open Batch Manager. Click on the queue listed in the server view, or select the queue view for that queue. Select Enable from the Queue menu, or select Enable Queue show as ENABLED in its listing in the server view. from the toolbar. The queue should now

19 The availability of the Enable and Disable menu and toolbar commands toggles, depending on the current inflow state of the queue. To disable a queue, take the following steps: 1. 2. 3. Open Batch Manager. Click on the queue listed in the server view, or select the queue view for that queue. Select Disable from the Queue menu, or select Disable Queue now show as DISABLED in its listing in the server view. from the toolbar. The queue should

The availability of the Enable and Disable menu and toolbar commands toggles, depending on the current inflow state of the queue. You must have at least operator privileges on the batch server to enable or disable a queue.

4.7 Starting and Stopping a Queue


A newly created queue has a stopped outflow state; it will not run any jobs it contains. A queue must be started to run jobs. To start a queue, take the following steps: 1. 2. 3. Open Batch Manager. Click on the queue listed in the server view, or select the queue view for that queue. Select Start from the Queue menu, or select Start Queue show as STARTED in its listing in the server view. from the toolbar. The queue should now

The availability of the Start and Stop menu and toolbar commands toggles, depending on the current outflow state of the queue. To stop a queue, take the following steps: 1. 2. 3. Open Batch Manager. Click on the queue listed in the server view, or select the queue view for that queue. Select Stop from the Queue menu, or select Stop Queue show as STOPPED in its listing in the server view. from the toolbar. The queue should now

The availability of the Start and Stop menu and toolbar commands toggles, depending on the current outflow state of the queue. You must have at least operator privileges on the batch server to start or stop a queue.

20

4.8 Displaying Queue Status


You can display the status of any queue on the batch server on your system, and of any queues on any batch servers on remote systems. Queue status information includes queue type, queue priority, inflow state, outflow state, and a count of the jobs currently in the queue. To display the status of a queue on your system, double-click on the queue listed in the server view, or select the queue view for that queue in the Batch Manager window. To display the status of a queue on another system, take the following steps: 1. 2. 3. Open Batch Manager. Select Connect to from the Server menu. Key in the name of the server on which the queue resides; then select OK. Batch Manager displays a server view for the selected server, listing the queues currently available on that server.

Use one of the following formats when keying in the server name: Windows NT system Remote Intergraph NQS system NOTE \\system_name @system_name

You can also use Connect To in the Queue menu to display a queue view for a particular queue on a remote system.

21

22

5. Submitting a Batch Job


This chapter describes how to submit a batch job, and monitor the status of submitted jobs, on a system running Batch Services for Windows NT. For more information on the Batch Manager interface, or for information on using the command-line interface, refer to Batch Services Help (BATCHMGR.HLP). You can use Batch Services to run an executable program on your system, or to perform a set of tasks on your system. To perform a set of tasks, you can create a script, a file containing instructions that can be interpreted by a shell. The following section describes scripts; the rest of the chapter describes how to submit and monitor batch jobs.

5.1 Creating a Script


A batch job reads a script and performs the instructions in it, using the appropriate shell (the program that runs the instructions in the script). Scripts can take many forms, including .BAT files and Perl scripts. A script can also be an executable program (.EXE file) if the queue has no default shell, or if the shell is set to CMD.EXE. The following example is a .BAT script that backs up a directory on the batch server to a shared drive that has been locally mounted from a remote system. To use the script, ensure that a local batch queue has been created, enabled, and started, and that the queues default shell is the CMD.EXE program.
REM This script will do the following: REM REM 1. Mount the shared drive \\machine\share REM 2. Copy everything in c:\users\default to the shared drive. REM 3. Unmount the shared drive. REM net use p: \\machine\share xcopy c:\users\default p: /e /i net use /delete p:

The following example is a .BAT script that prints all PostScript files in the C:\TEMP directory on the batch server to a printer on a remote Windows NT system. To use the script, ensure that a local batch queue has been created, enabled, and started; that the queues default shell is the CMD.EXE program; and that your system has access to the printer on the remote Windows NT system.
REM This script will do the following: REM REM 1. Associate a remote printer on a Windows NT system REM (\\machine\printer) with a local printer port. REM 2. Copy files in c:\temp that end in .ps to the local printer REM port. REM 3. Remove the printer association. REM net use lpt1: \\machine\printer cd c:\temp for %%I in (*.ps) do copy %%I lpt1: net use /delete lpt1:

23

5.2 Submitting a Job


To submit a job to be run on the batch server on your system, take the following steps: 1. 2. 3. 4. Open Batch Manager. Select a queue listed in the server view, or select the queue view for that queue. Ensure that the selected queue is enabled and started. Select Submit from the Job menu, or select Submit Job on the toolbar.

Batch Manager provides tabbed pages in the Job Submit dialog for the following job parameter categories: General Scheduling Notification Output Resources File Staging Advanced Sets basic information about the job. Sets the parameters associated with scheduling the job for execution. Sets the notification preferences for the job. Specifies how output should be handled for the job. Configures job resources needed for the batch job. Describes how necessary files for the job are handled. Sets advanced job parameters as well as those that are only used by Intergraph NQS.

The following sections describe basic operational parameters found in the Job Submit dialog, along with brief instructions for using them when submitting a job.

5.2.1 Setting Basic Job Information


Use the General page to set basic information about the job, including the script to be submitted for execution. This page contains the following fields: Script The script to be submitted for execution. Key in the filename of a script for submission. You may also select Browse to browse this computer or the network for an executable program to use. The name of the script should not contain any characters that have special meaning to the shell associated with the queue. Queue Name Default Queue The queue to which the job is submitted. Key in a queue name according to the syntax described in Chapter 4. The default queue for the local server. Checking this box fills the Queue Name field with the name of the default queue for the local server. See 4.3, Setting the Default Queue, for instructions on how to set the default queue. A user-defined name for the job. Determines whether the job should be restarted after a system crash, system shutdown, or batch service shutdown while the job is running. This option is selected by default.

Job Name Restartable

24

Shell

Displays the currently selected shell for the job. If this value is not specified, the default shell for this queue will be used.

5.2.2 Setting Job Scheduling Information


The Scheduling page describes the various parameters associated with scheduling the job for execution, including the start time, whether or not the job should be submitted with a hold, and the priority for scheduling the job. Job Occurs The execution interval of the job. Choose to have the job execute once or multiple times at an hourly, daily, weekly, monthly, or yearly interval. One-time execution is the default. Recurrence patterns for jobs that are scheduled to execute more than once. Hourly, daily, weekly, monthly, and yearly patterns are available. For jobs that execute only once, the start date specifies the date when the job should start. For recurring jobs, the effective date is the date when the specified recurrence pattern should go into effect. The current date is the default setting. The time when the job should be allowed to start. Select the Current Time checkbox to choose a jobs submission time as its execution time. Clear the Current Time checkbox, and select an hour and a minute to choose a specific time for the job to start. The current time is the default setting. Displays the date and time of the next scheduled occurrence of a recurring job. This field is not displayed for one-time jobs. Specifies the number of days a job should be run. 0 indicates eternity. Determines whether the job should be restarted after a system crash, system shutdown, or batch service shutdown while the job is running. This option is selected by default.

Recurring Jobs Frequency Start Date/Effective Date Start Time

Next Occurrence Number of Days Restartable

5.2.3 Creating Recurring Jobs


If you have a task that recurs on a regular basis, such as a nightly backup, you can schedule it as a recurring job. You only schedule recurring jobs once, and then Batch Services automatically runs all future occurrences of the job for you. As an example, we will schedule a system backup to run every Tuesday and Thursday at 7:00 PM, starting on the first of September 2001. To do this, take the following steps: 1. 2. 3. 4. 5. Open Batch Manager and select the queue to which you wish to submit the recurring job. Select Submit from the Job menu. Browse for and select the backup script that you want to run. Select the Scheduling tab. Select weekly job frequency by choosing the Weekly radio button.

25 6. 7. 8. 9. Select a weekly frequency of every 1 week. Select the Monday and Thursday checkboxes, making sure that no other checkboxes are selected. Set the effective date to September 1, 2001. Set the start time to 19:00 (7:00 PM). The Next Occurrence field will note that the first occurrence of the backup job will be run on Tuesday, September 1, 2001 at 7:00 PM.

5.2.4 Specifying Job Notification Preferences


The Notification tabbed dialog describes the notification preferences for the job, including under what conditions notification should be sent, and the mail address to which notification information should be sent. Job Start Job Completion Job Abort Specifies the notification option. You can be notified of the following events: The job begins execution (Job Start). The job completes execution (Job Completion). The job is aborted (Job Abort).

Job Abort is selected by default. Mail Address By default, notification messages are written to the Event Log of the submitting machine. This field lists mail addresses in the form \\host (the event log on system host) or user@host (an SMTP mail address). Mail will be sent to each recipient. Key in a mail address, and select Add to add the address to the List box. You can specify more than one recipient by keying in addresses separately, and selecting Add after each address.

5.2.5 Specifying How to Handle Job Output


The Output page specifies how the output should be handled for the job, including where to store standard error and standard output files. This page provides the following options: Standard Output/ Standard Error Specifies a path and filename indicating where to store the standard error and standard output files. For local files, key in the complete pathname. You can specify a network pathname using one of the following formats: \\host\pathname\filename host:pathname/filename Keep Output on Execution Host No Spooling Windows NT Intergraph NQS

Specifies whether or not the output should be kept on the machine where the job runs. Specifies whether or not output is to be created directly in the specified pathname. Normally, the output file is kept internally by Batch Services until the batch job ends; the files are then returned to the intended directories. Spooling is not supported on remote machines. Disables the Standard Error group box, indicating that all output should be sent to the Standard Output Pathname. If the Join Output is unselected, the Standard Error group box becomes available again.

Join Output in One File

26

5.2.6 Specifying Job Resource Requirements


The Resources page configures the various job resources needed for the batch job. This page provides the following options: Environment group Enters and updates environment variables. Variable Value Add Current Environment Variables Specifies the environment variable name. Key in the variable name. Specifies the environment variable value.

Adds all environment variables in the current environment to the name list.

5.3 Saving and Restoring Named Batch Jobs


A batch job can be saved to a file for later recall, modifications, and submissions. This is especially useful if you want to set up certain job parameters to be used again and again. For example, you might have a certain set of people you wish to notify whenever a backup runs. You could create a named job that contains the name of your backup script, the queue in which it should run, and the notification list, and save it as BACKUP.NJOB. To run a backup job, you would then open the named job using the Job Submit dialog, make any necessary changes (perhaps the start time of the job), then submit the job. Using this method, you do not have to re-enter the job's parameters each time you want to run the job. Once you have created a named job, you can access it in a variety of ways. Any of the following methods open the named job and complete the Job Submit dialog with all of its parameters: Select the Open button on the Job Submit dialog, browse for the named job, and select OK. Drag the named job file from File Manager into the Batch Manager window. Key in the command batchmgr named_job.NJOB at the command prompt, where named_job is the name of the job file. Double-click on the named job file in File Manager. The last two methods will not work if Batch Manager is already active since only one Batch Manager session at a time is allowed.

NOTE

5.3.1 Creating a Named Job


To create a named job, take the following steps: 1. 2. 3. Select Submit from the Job menu to display the Submit dialog. See 5.2, Submitting a Job, for more information about the Submit dialog. Enter the job parameters that you wish to save as a named job. Select Save As to name and save your job.

27

5.3.2 Submitting a Named Job


To recall and submit a previously saved named job, take the following steps: 1. 2. 3. 4. Select Submit from the Job menu to display the Submit dialog. Select Open to browse for previously saved named jobs. Choose the named job you wish to recall, and select OK. Batch Manager loads the saved job parameters into the Job Submit dialog, and displays the name of the job in the title of the Job Submit dialog. You may submit the job exactly as it was stored in the named job file, or you can make modifications. If you wish to save changes you make, select Save to overwrite the existing named job, or select Save As to choose a new name for the modified job. Select Submit to submit the job.

5.

28

Glossary
account mapping The process of determining the account name to use when running jobs. Batch Services requires an account name and password to use when running jobs. To perform account mapping, the server tries to match the job owner with an account mapping entry. A set of instructions to Batch Services to perform a given task or set of tasks on a computer system. A batch job is identified with a script that is run by a shell. The job may also be an executable (.EXE). See also job, shell. A queue that accepts requests to execute scripts or commands from the keyboard as if the user submitting the request were logged in to the system. See also queue. A Windows NT service that processes batch jobs, and maintains queue and job information. Also, the system on which Batch Services runs. The queue to which a job is assigned when a user does not specify a queue. The shell that is used to run a job submitted to a queue when a user does not specify a shell for that job. A queue state in which the queue will not accept new jobs. A queue state in which the queue will accept new jobs. The machine where a batch job is run. A delay in running a job submitted to a queue. A held job will not run until the hold is released. A user hold may be placed on a job submitted by that user when the job is submitted. An operator hold may be placed on a job by a user with operator or manager privileges, after the job is submitted but before it runs. See also privilege. The state of a queue with regard to accepting jobs. See also queue state, enable, disable. A set of instructions needed to perform a given task or set of tasks on a computer system. See also batch job, shell. A unique alphanumeric string that identifies a job. A batch job ID is in the form jobid.orighost, where jobid is a sequentially assigned number up to 5 digits in length, and orighost is the name of the system from which the batch job originated. See privilege. A network-based, multipurpose printing, plotting, and command-execution system that runs on Intergraph and other UNIX-based systems.

batch job

batch queue

batch server default queue default shell disabled enabled execution host hold

inflow state job job identifier (job ID)

manager Intergraph Network Queuing System (NQS)

29

operator outflow state pipe queue

See privilege. The state of a queue with regard to processing jobs. See also queue state, start, stop. A queue that routes jobs to another queue. A pipe queue receives a job and routes it to the first available queue on its destination list that will accept the job. Pipe queues can accept jobs from batch queues or from other pipe queues. An operational permission level assigned to every Batch Services user. Nonprivileged users can submit jobs to queues to which they have been granted access; operators can issue commands that directly affect queue management; and managers can control all aspects of Batch Service operation. A waiting line in which jobs reside until they are processed. See also batch queue, pipe queue. The operational state of a queue. A queue has an inflow state that is either enabled or disabled; it also has an outflow state that is either started, stopped, or stopping. See also enabled, disabled, started, stopped. The view in Batch Manager that shows information on the jobs in a queue. A file that contains instructions for the execution of a batch job. The view in Batch Manager that shows information about the operation of one or more queues. An executable program that can be used to run a script. For example, CMD.EXE is a shell that can be used to run .BAT scripts. See also script. The process of storing a file internally by Batch Services until the batch job ends. A queue state in which the queue will run jobs submitted to it. A queue state in which the queue will not run jobs submitted to it.

privilege

queue queue state

queue view script server view shell spooling started stopped

30

Index
A
access to desktop, 7 account mapping, 7, 12, 28 adding destinations, 18 adding shells, 17 adding shells, 17 default shell, 17 disabling, 18 enabling, 18 modifying, 16 starting, 19 status, 20 stopping, 19 removing privileges, 12 server view, 29 setting default queue, 17 starting queues, 19 status bar, 11 stopping queues, 19 submitting named batch job, 27 using, 10 views, 10 batch queue, 28 batch server, 28 Batch Services account mapping, 7, 12 batch job, 22 basic information, 23 job output, 25 notification, 25 resources, 26 scheduling, 24 submitting, 23 Batch Manager, 10 compatibility with network adapters, 6 components, 3 configuring desktop access, 8 destination directory for product files, 7 getting started using, 4 installation requirements, 6 installing, 6 named batch job, 26 creating, 26 submitting, 27 privileges, 11, 12 queue default, 17 queues, 14 adding destinations, 18 adding shells, 17 creating, 14 batch, 14 pipe, 15 default shell, 17 deleting, 15 disabling, 18 enabling, 18

B
batch job, 28 basic information, 23 creating named, 26 job output, 25 named, 26, 27 notification, 25 resources, 26 scheduling, 24 script, 22 submitting, 23 batch job, 22 Batch Manager, 10 account mapping, 12 adding destinations, 18 adding shells, 17 batch job, 22 basic information, 23 job output, 25 notification, 25 resources, 26 scheduling, 24 submitting, 23 creating queues, 14 batch, 14 pipe, 15 default shell, 17 deleting queues, 15 disabling queues, 18 enabling queues, 18 granting privileges, 11 named batch job, 26 creating, 26 overview, 10 queue default, 17 queue status, 20 queue view, 29 queues, 14 adding destinations, 18

31
modifying, 16 starting, 19 status, 20 stopping, 19 removing, 9 setting default queue, 17 starting, 7, 8 stopping, 8 using Batch Manager, 10 Batch Services Help, 1

N
named batch job, 26 creating, 26 submitting, 27 network adapters and Batch Services, 6

O
online documentation, 1 outflow state, 29 started, 29 stopped, 29

C
creating a named batch job, 26 creating script, 22

D
default queue, 28 default shell, 17, 28 desktop access, 7, 8 disabling queues, 18 DNS, 6

P
pipe queue, 29 privilege, 29 privileges granting, 11 removing, 12 product directory for Batch Services, 7

E
enabling queues, 18 execution host, 28

Q
queue, 29 inflow state, 28 outflow state, 29 queue state, 29 queue status, 20 queue view, 29 queues, 14 adding destinations, 18 adding shells, 17 creating, 14 batch, 14 pipe, 15 default shell, 17 deleting, 15 disabling, 18, 20 enabling, 18 modifying, 16 properties, 16 setting default, 17 starting, 19 stopping, 19

G
Getting started using Batch Services, 4

I
inflow state, 28 disabled, 28 enabled, 28 installation requirements, 6 installing Batch Services, 6 Intergraph finding on the Internet, 2 Intergraph NQS, 6, 28 Internet finding Intergraph, 2

J
job, 28 job hold, 28 job ID, 28

R
removing Batch Services, 9

32

S
script, 29 server view, 29 shell, 29 spooling, 29 starting Batch Services, 7, 8 starting queues, 19 status bar, 11 stopping Batch Services, 8 stopping queues, 19 submitting a batch job, 23 submitting a named batch job, 27

T
TCP/IP, 6 telephone support, 2 training, 2

V
views, 10

33

Вам также может понравиться