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

9.1 Jobs samples

To test diogene87, we need some jobs samples. You could find this samples in Diogene87's shared directory (`/usr/local/share/diogene87/samples' or `/usr/share/diogene87/samples').

You can copy this job samples in another directory (like `/tmp') and change the execute permission :

 
$cp /usr/local/share/diogene87/samples/job* /tmp
$chmod a+x /tmp/job*
$ ls -l /tmp/job*
-rwxr-xr-x    1 d d 108 jan  9 14:58 /tmp/job1.sh
-rwxr-xr-x    1 d d 109 jan  9 14:58 /tmp/job2.sh
-rwxr-xr-x    1 d d 109 jan  9 14:58 /tmp/job3.sh
-rwxr-xr-x    1 d d 108 jan  9 14:58 /tmp/job4.sh
-rwxr-xr-x    1 d d 123 jan  9 14:58 /tmp/job5.sh
$

The first job is `job1.sh' :

 
#!/bin/sh
/usr/bin/logger "Diogene87 job 1 : start"
sleep 5
/usr/bin/logger "Diogene87 job 1 : end"
exit 0

This job writes a message in the system log, waits 5 seconds, and writes another message in the log. You can test it :

 
# /tmp/job1.sh
# tail /var/log/messages
Nov 21 13:45:10 PRDNPSD -- MARK --
Nov 21 14:15:11 PRDNPSD dparisot: Diogene87 job 1 : start
Nov 21 14:15:16 PRDNPSD dparisot: Diogene87 job 1 : end

The second job has a temporization of 10 seconds (job2.sh) :

 
#!/bin/sh
/usr/bin/logger "Diogene87 job 2 : start"
sleep 10
/usr/bin/logger "Diogene87 job 2 : end"
exit 0

The third job has a temporization of 15 seconds (job3.sh) :

 
#!/bin/sh
/usr/bin/logger "Diogene87 job 3 : start"
sleep 15
/usr/bin/logger "Diogene87 job 3 : end"
exit 0

job4.h has a temporization of 5 seconds :

 
#!/bin/sh
/usr/bin/logger "Diogene87 job 4 : start"
sleep 5
/usr/bin/logger "Diogene87 job 4 : end"
exit 0

job5.sh waits 5 seconds and returns a non zero exit code ! This job will be used to simulate an abort.

 
#!/bin/sh
/usr/bin/logger "Diogene87 job 5 : start"
sleep 5
/usr/bin/logger "Diogene87 job 5 : end (exit code=1)"
exit 1 

You are now ready to do Diogene87 samples.


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

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