You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Scripting Jobs in the Standard Unix Scripting Languages (sh, Perl)

sh and Perl scripts can be launched as executables.

Even more interesting are scripted jobs that make use of the JobScheduler's API Interface, e.g.

  • to write to the JobScheduler logs which are visible in JOC, the JobScheduler Operations Center interface interface (and automatically mail logs in case of errors, warnings or success),
  • to set the job processing state,
  • to launch other jobs via API and to process job parameters.

Scripted jobs with the API support are not just launched in a new process, but run in a child instance of the JobScheduler. This exposes the API objects and methods directly to the script. The JobScheduler is linked to the language interfaces for the scripting languages supported.

Jobs that make use of the API are preferably written in

  • Java,
  • JavaScript
  • Perl jobs with API support may be operated for Windows provided that an ActiveState implementation is installed. For Linux and Solaris there are restrictions due to the fact that Perl is not threadsafe implemented. We have to link the Perl libraries to the JobScheduler for these platforms.

a) Example Standalone Perl Script

The example package of the installation contains the files "scheduler_samples_perlscript.xml" and "sample_script_notification.pl" that show the configuration and implementation for a job named "sample_script_notification". Job starts for this simple script are triggered by changes in the given directory.

b) Example Perl Script using JobScheduler API

The file "sample_api_notification.pl" of the example installation package is a more complete example that demonstrates the usage of JobScheduler API for logging and error handling. This script moves files from one directory to another as soon as they appear and is triggered by directory notification. (this example script was tested for Windows (ActiveState) and Linux with Perl 5.8)

The difference between a) and b) is that a) runs standalone in the command line whereas b) is driven by callbacks from the JobScheduler.

  • No labels