Examples

Lets see what Oddjob can do.

In addition to these examples, there is also many examples from the Reference, this User Guide, and the Developer Guide in the examples directory

Hello World

All examples should begin with the simplest example possible and here it is!

Hello World

Execute a batch file

This example demonstrates executing a batch file from Oddjob and introduces us to using sequences of jobs and variables.

The example consists of a sequence of two jobs. The first sets a variable, the second executes the batch file with the variable value passed in as an argument.

Exec Example

Conditional Paths

An 'if' job uses the return state of one job to decide which of a number of alternate job branches to execute.

This job uses a random task to simulate jobs executing with mixed results. The example is run in a timer loop to continually show the flow of events.

Hello World

A Scheduling Example

This is a demonstration of the flexible scheduling features of Oddjob. A file is downloaded via ftp daily. If the download fails after a number of retries an email is sent.

Scheduling

The files are downloaded from the CME ftp site. This is one of the real life scheduling examples that inspired Oddjob. Points of interest include that the filename contains the date and the files are distributed in different time zones.

The example comes in two forms, a live example that will ftp the files back, and an example that substitutes random dummy jobs so the demonstration can still be seen working off line.

Sharing Jobs on A Network

And saving the best till last - this example shows how an Oddjob client can be used to monitor Oddjob running on a remote server.

Sharing Oddjob

Although here we have the client and server running in the same folder.

If this example doesn't work it might be because your machine doesn't recognise localhost. When you've learnt about configuring Oddjob come back and try changing the client and server configurations to contain your network name or IP address.

To see the examples really working across the network change the client configuration from localhost to the name or IP address of your server and run the client example on a different machine.


Index Top Next