7.5 Deploying Jobs

A job must be deployed to the Orchestrator Server before it can be run. Deployment to the server is done in either of the following ways:

7.5.1 Using the Orchestrator Console

  1. In the Actions menu, click Deploy Job.

  2. For additional deployment details, see Walkthrough: Deploy a Sample Job.

7.5.2 Using the ZOSADMIN Command Line Tool

From the CLI, you can deploy a component file (.job, .jdl, .sar) or refer to a directory containing job components.

.job files are Java jar archives containing .jdl, .policy, .sched and any other files required by your job. A .sar file is a Java jar archive for containing multiple jobs and policies.

  1. To deploy a .job file from the command line, enter the following command:

    >zosadmin deploy <myjob>.job
    
  2. To deploy a job from a directory where the directory /jobs/myjob contains .jdl, .policy, .sched, and any other files required by your job, enter the following command:

    >zosadmin deploy /jobs/myjob
    

    Deploying from a directory is useful if you want to explode an existing job or .sar file and redeploy the job components without putting the job back together as a .job or .sar file.

  3. Copy the job file into the “hot” deploy directory by entering the following command:

    >cp <install dir>/examples/whoami.job <install dir>/deploy
    

As part of an iterative process, you can re-deploy a job from a file or a directory again after specified local changes are made to the job file. You can also undeploy a job out of the system if you are done with it. Use zosadmin redeploy and zosadmin undeploy to re-deploy and undeploy jobs, respectively.

A typical approach to designing, deploying, and running a job is as follows:

  1. Identify and outline the job tasks you want the Orchestrator Server to perform.

  2. Use the preconfigured JDL files for specific tasks listed in Section A.0, Orchestrator Job Classes and JDL Syntax.

  3. To configure jobs, edit the JDL file with an external text editor.

  4. Repackage the job as a .jar file.

  5. Run the ZOS administration tool to redeploy the packaged job into the Orchestrator Server.

  6. Run the job using the zos command line tool.

  7. Monitor the results of the job in the ZENworks Orchestrator Console.

Another method to deploy jobs is to edit JDL files through the Orchestrator Console. The console has a text editor that enables you to make changes directly in the JDL file as it is stored on the server ready to deploy. After changes are made and the file is saved using the Orchestrator Console, you simply re-run the job without redeploying it. The procedure is useful when you need to fix typos in the JDL file or have minor changes to make in the job functionality.

NOTE:Redeploying a job overwrites any job that has been previously saved on the Orchestrator Server. The Orchestrator console has a Save File menu option if you want to preserve JDL modifications you made using ZOC.