All pages
1 of 5

Loading...

Loading...

Loading...

Loading...

Loading...

CopyStorm/JobRunner Credentials

CopyStorm/JobRunner requires that the credentials for a CopyStorm/Director database be specified. There are two ways to specify credentials:

  • Explicitly as clear text on the command line.

  • Explicitly as an encrypted token on the command line.

The clear text approach is simple but not very secure. For example:

  • CopyStormJobRunner.bat -cstype postgresql -csdatabase //localhost/copystormjob -csuser root -cspassword helloworld

The command line arguments shown are exactly the same data that is required to launch CopyStorm/Director.

To launch with an encrypted token requires a bit of setup but keeps intruders from seeing a visible password.

  • The credential token is a DES-256 encrypted string.

  • Example: CopyStormJobRunner.bat -cscredentials “u0JmFcF4te6InFu0owWtmRTpxMsqwnFp9MXeR7hf2LbQtxHgaHsaGt7i8CeYscQ9ZjvOObWGE6Frh2gLOIVILIruq7mYeXuUJLaYOxFuMCHKtxb4wBu5l+HoN41d1hWe+tLKNFuvyDUJEC9hMSWvkg==”

The process to generate a credential token involves one of:

  • Opening the Job Runner tab on the CopyStorm/Director GUI and copying the generated token.

  • Running CopyStorm/JobRunner on the command line with clear text credentials and the action “-action makeCredentials”.

Capstorm recommends that an encrypted token always be used. However, anywhere CopyStorm/Director database are illustrated in the documentation, either form of credentials may be used.

Command Line Options

CopyStorm/JobRunner supports the following command line options:

Option
Argument(s)
Description

-action

string

The operation CopyStorm/JobRunner should perform. Supported actions include:

  • runScheduled — run available pending jobs.

  • status — display a brief summary of all jobs.

  • makeCredentials — create an encryption token usable with the -cscredentials option.

  • runCopyStorm — used in conjunction with the -jobs flag to force specific CopyStorm jobs to run.

-maxJobs

integer

Limits the number of concurrent CopyStorm and CopyStorm/Medic jobs. The value is global and enforced across all active copies of the CopyStorm/JobRunner.

The following sample command lines illustrate how the various options are used.

sh CopyStormJobRunner.sh -action runScheduled -cscredentials “xyzzy”

Note: It is bad practice to use clear text credentials on the command line.

CopyStormJobRunner.bat -action runScheduled -cstype postgresql -csdatabase //localhost/copystormjob -csuser root -cspassword mypassword

sh CopyStormJobRunner.sh -action runScheduled -maxJobs 10 -cscredentials “encrypted-credentials-string”

sh CopyStormJobRunner.sh -action makeCredentials -cstype postgresql -csdatabase //localhost/copystormjob -csuser root -cspassword mypassword

sh CopyStormJobRunner.sh -action runCopyStorm -jobs 1,5 -cscredentials “encrypted-credentials-string”

sh CopyStormJobRunner.sh -action status -cscredentials “encrypted-credentials-string”

runCopyStormMedic — used in conjunction with the -jobs flag to force specific CopyStorm/Medic jobs to run.

-jobs

string

A comma-separated list of unique job ids. Job range expressions are also supported. For example:

  • 1,3,4

  • 1-10,11,12,15-20

-family

string

Limits the family of tasks that will run when the -runCopyStorm or -runCopyStormMedic option is used. The default value for this parameter is “Default”.

-cscredentials

string

An encrypted string containing all the information required to connect to a CopyStorm/Director database.

-cstype

string

The database type of the CopyStorm/Director database. Supported values include:

  • sqlserver

  • oracle

  • mysql

  • postgresql

  • h2

-csdatabase

string

The JDBC connection string used to connect to the CopyStorm/Director database.

-csuser

string

The username used to authenticate with the CopyStorm/Director database.

-cspassword

string

The password used to authenticate with the CopyStorm/Director database.

-apachelog

If this flag is present, the org.apache.commons.logging system will be used. Otherwise a default logging system that writes to stderr will be used.

-silent

If this flag is present, the application will not generate any messages unless an error is encountered.

Run All Scheduled Jobs

Run All Scheduled Jobs With Clear Text Credentials

Run All Scheduled Jobs but No More Than 10 Simultaneously

Generate an Encrypted Token That Can be Used for the -cscredentials Option

Force the Default CopyStorm Task for Jobs 1 and 5 to Run

Tell Me How Many Jobs are Running (and other status information)

Approach 1: Copy a Credentials Token From the CopyStorm/Director GUI.

Approach 2: Generate a Credentials Token From CopyStorm/JobRunner

Add CopyStorm/JobRunner to a Scheduler

This article explains how to add CopyStorm/JobRunner to your system scheduler so it will run unattended on a schedule you specify.

Step 1: Create a CopyStorm/JobRunner Command Line

The first step is to create a CopyStorm/JobRunner command that can be successfully ran from the command line. The easiest way to do this is to open the Job Runner tab in the CopyStorm GUI and copy the command already generated:

It is a good idea to put the command line into a script file. Within this documentation, the script was put into a file named:

  • Windows: C:\bin\MyCopyStormJobRunner.bat

  • Linux/Mac: /usr/local/bin/MyCopyStormJobRunner.sh

The next two sections describe the steps to follow on Linux/Mac and Windows. The only things the two procedures have in common are:

  • The CopyStorm/JobRunner is scheduled to run every 10 minutes. If there is nothing to do it takes less than a second to run. This is perfectly safe for two reasons:

    • Multiple CopyStorm/JobRunner jobs will not interfere with each other.

    • The limit on the maximum number of jobs to run at any one time is enforced across all running CopyStorm/JobRunner instances.

For more information about Crontab formats or background information on the cron scheduler, see .

Use the command “crontab -e” and add an entry for MyCopyStormJobRunner.sh.

An entry to run CopyStorm/JobRunner every 10 minutes would look like:

  • 0,10,20,30,40,50 * * * * sh /usr/local/bin/MyCopyStormJobRunner.sh

Find and open the Windows Scheduler.

Open the Create Basic Task wizard.

Enter basic information about the task.

Indicate when the task will run. Within the wizard this will be Daily. After the wizard completes we will change this to every 10 minutes.

Tell the scheduler to run our script — MyCopyStormJobRunner.bat.

On the next page, the confirmation page, click on “Finish” and the job will be scheduled. The next task is to change the job interval to every 10 minutes.

Open the Task Editor for the newly created task.

Open the trigger schedule for editing.

Update with the following parameters and save your work. This will cause CopyStormJobRunner.bat to be scheduled to run every 10 minutes (forever).

Step 2: Linux/Mac Only: Add MyCopyStormJobRunner.sh to CRON.

Step 3: Windows Only: Add MyCopyStormJobRunner.bat to the Windows Scheduler.

the Wikipedia page for cron

Force a Job to Run On Demand

Forcing a specific CopyStorm job to run on demand requires three things:

  • Database credentials for the CopyStorm/Director database.

  • The unique integer Job Number for the job containing the task to run.

  • The family to which the job belongs.

All of this data is visible when viewing a job in the CopyStorm/Director GUI:

With this information, the following command line will force the corresponding CopyStorm job to run immediately:

  • Windows:

    • CopyStormJobRunner.bat -action runCopyStorm -jobs 1 -family Default -cscredentials “encrypted-credentials-string”

  • Linux/Mac:

    • sh CopyStormJobRunner.sh -action runCopyStorm -jobs 1 -family Default -cscredentials “encrypted-credentials-string”

If the job is a CopyStorm/Medic task, change the -action argument to CopyStormMedic:

  • Windows:

    • CopyStormJobRunner.bat -action runCopyMedic -jobs 1 -family Default -cscredentials “encrypted-credentials-string”

  • Linux/Mac:

    • sh CopyStormJobRunner.sh -action runCopyMedic -jobs 1 -family Default -cscredentials “encrypted-credentials-string”

The log file and status of the run will be stored in the CopyStorm/Director database — just as if the CopyStorm/JobRunner were invoked from a scheduler.

CopyStorm/JobRunner will output information similar to the following example:

Only a single task in a job can be forced to run on demand at the same time. See the for more details.

CopyStorm/JobRunner command line options

CopyStorm/JobRunner

CopyStorm/JobRunner is the command line tool used to run jobs defined by CopyStorm/Director.

  • CopyStorm/JobRunner is typically scheduled as a job using a native scheduler (e.g. Windows Scheduler or CRON).

    • In this mode it will read job scheduling data from the CopyStorm/Director database and run the appropriate jobs.

  • CopyStorm/JobRunner can be used to force jobs to run outside of their normal schedule.

In the following diagram, the CopyStorm/JobRunner is outlined in red:

There are two steps to using CopyStorm/JobRunner:

  • Specify credentials for a CopyStorm/Director database.

  • Run the application from a command line prompt or a scheduler.

CopyStorm/JobRunner’s main purpose is to execute jobs defined in a CopyStorm/Director database — the first procedure that must be understood is how to pass database credentials to CopyStorm/JobRunner. Please read and understand the before trying to run CopyStorm/JobRunner.

  • — complete command-line reference for CopyStorm/JobRunner.

Step 1: Understand How to Specify Database Connection Parameters

Step 2: Jump to the Task You Want to Perform

Related Articles

CopyStorm/JobRunner Credentials article
Add CopyStorm/JobRunner to a System Scheduler.
Force a CopyStorm Job to Run on Demand.
CopyStorm/JobRunner Command Line Documentation