[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6. Quick start

If you followed one of the previous section to install Diogene87, you should have a computer where the `dio87d' daemon is running.

This section shows an utilization example of Diogene87. You'll have a first approach of this product and you'll check if all goes well.

In this example, we'll create a task consituted of three jobs which will run one after the other.

First, we create a referential `ref1'. A referential is a sort of model (a template) where we'll create our first task. To create this referential, we use the ra command with its name :

 
$ dio87c ra ref1
$

In this referential, we create a task `t1' with the rta command :

 
$ dio87c rta ref1 t1
$

By default, a task which was just created, is linked with the local computer. We doesn't need to change it, because we want to execute this task on the local computer. If we would execute the task on another computer, we should use the rtst command.

We must define which days the task must be executed. It consists to add one or more operations which add or remove range of days. In this example, the task will be executed every days : we add an `add always' operation with the `rtoa' command :

 
$ dio87c rtoa ref1 t1 add always
$

Now, we must define what the task does. A task is consitued of one or more jobs ; every job corresponds to a script or a command (with arguments).

We add a job `job1' in the task `t1' with the `rja' command. We use the `rjsp' command to set the path of the command to execute (`/bin/echo' in our example). Then, we use the `rjsa' command to define the arguments which are passed to the `echo' command (`begin of the task' in our example) :

 
$ dio87c rja ref1 t1 job1 
$ dio87c rjsp ref1 t1 job1 "/bin/echo"
$ dio87c rjsa ref1 t1 job1 "begin of task"
$

We create a second job `job2' which executes a temporization of 60 seconds. The command is `/bin/sleep' and the argument is `60' :

 
$ dio87c rja ref1 t1 job2 
$ dio87c rjsp ref1 t1 job2 "/bin/sleep"
$ dio87c rjsa ref1 t1 job2 60
$

We create a third job `job3' which prints a message on the console. The command is `/bin/echo' and the argument is `end of task' :

 
$ dio87c rja ref1 t1 job3 
$ dio87c rjsp ref1 t1 job3 "/bin/echo"
$ dio87c rjsa ref1 t1 job3 "end of task"
$

Of course, you can use other commands to consult the referential. For example, the `rjl' command prints the list of jobs of a task :

 
$ dio87c rjl ref1 t1 
job1
job2
job3
$

If we send the task now, we should see that the three jobs `job1', `job2' and `job3' start at the same time. To force them to execute one after the other, we must create jobs dependencies : a dependence between `job1' and `job2', another between `job2' and `job3'. The rjda command is used to create job dependencies :

 
$ dio87c rjda ref1 t1 job1 job2
$ dio87c rjda ref1 t1 job2 job3
$

OK, all is ready ! We just have to create a exploitation day from our referential for this day. We call the rp command with the name of the referential to plan and the date of the current day (with the format `YYYY-MM-DD' :

 
$ dio87c rp ref1 "2004-01-05" 
New day name : ref1_20040105
from referential : ref1
start time : 2004-01-05 00:00:00
$

The day creation process is launch. It consists to select in the referential all tasks which must be executed for this day and to copy them in the new exploitation day.

To print the list of exploitation days, we use the xdl command. The new day is `ref1_20040105' :

 
$ dio87c xdl 
ref1_20040105
$

We print the task list of this day with the xtl command. The `-s' of this command prints the current state of each tasks.

 
$ dio87c -- xtl -s ref1_20040105
t1        running
$

The task is running. We print the job list of the task with the xjl -s command (the `-s' option prints the state of the jobs) :

 
$ dio87c -- xjl -s ref1_20040105 t1
job1      terminated
job2      running
job3      wait_for_dep 
$

The job `job1' is terminated, it corresponds to the `echo' command. `job2' is running, it's the temporization. `job3' is waiting for dependencies : it waits the end of `job2'.

After one minute, all three jobs are terminated and the task is terminated too:

 
$ dio87c -- xtl -s ref1_20040105
job1      terminated
job2      terminated
job3      terminated
$
$ dio87c -- xtl -s ref1_20040105
t1        terminated
$

We can print the history of tasks and jobs. For example, we use the `ljel' command to print the history of `job1'.

 
$ dio87c -- ljel -o ref1_20040105
2004-01-05 15:05:50     wait_enabled
2004-01-05 15:05:52     output   Path:/bin/echo
2004-01-05 15:05:52     output   Argument:d'ebut de t^ache	
2004-01-05 15:05:52     command xju 'running' 0 (by 'diogene')
2004-01-05 15:05:52     running 
2004-01-05 15:05:52     output   début de tâche
2004-01-05 15:05:52     command xju 'exit' 0 (by 'diogene')
2004-01-05 15:05:53     terminated 
$

You can see that the message which was print by the echo command, is recorded in the history. In fact, all outputs on the standard output or on the error output are stored.

This short example is terminated. You must know that Diogene87 has more advanced features. For example, tasks can be executed on remote computers. It's also possible to define start conditions for task (wait for an hour, for a file presence, for a manual confirmation). Dependencies can be defined between tasks. A dependence can wait for the normal termination or for an anormal termination of the upstream job or task... These features are described in this documentation.

To terminate, you can make some cleanup by deleting the exploitation day and the referential :

 
$ dio87c xdk ref1_20040105
$ dio87c rk ref1
$


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by dom on September, 11 2005 using texi2html