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

9.15.2 Automated deletion of exploitation days

We saw that we must call the xdk command every time we want to delete an exploitation day.

Fortunately, it's possible to automatically delete exploitation days when they have reached a time limit. You must set to true the `auto purged' property of an exploitation day, if you want the exploitation to be automatically delete when it has reached the time limit.

Every day at midnight, all days whose `auto purged' property is set to true and whose start time is older than the day limit, are automatically deleted.

The day limit, which is a number of days, is defined by the field `DAY_PURGE_RETENTION' in the configuration file `dio87d.conf'. If you change this value, don't forget to send a SIGHUP signal to the daemon `dio87d' to force it to reread the configuratin file.

If you want to see the value of the time limit, you can call the ei command :

 
$ dio87c ei
Day Retention: 7
[...]
$

The xdsa command changes the value of the `auto purged' property of an exploitation day. The parameters are the name of the exploitation day and the boolean value of the property (`true' or `false').

When a day is created, the value of the `auto purged' property is copied from the referential which is used to create the day. By default, the value of this property is set to false, it means that all days which are created from this referential will never be automatically deleted.

It's possible to change the value of the `auto purged' property of the referential by using the rsa command. If this property is set to true, all days which are created from this referential, have an `auto purged' property which is set to true : they will be deleted after the time limit.

In this example, we will create a referential and we'll plan two days from this referential : one which is older than the time limit, and one which is more recent. We'll verify that the exploitation days are not deleted when their `auto purged' property is set to false. Then we'll activate the `auto purged' property for the two exploitation days, and we'll check that the exploitation day which is beyond the time limit, is deleted.

Then, we'll set the `auto purged' property of the referential to true, and we'll plan a new day from the referential : we'll check that the value of this property is copied from the referential to the exploitation day.

First, we create a referential `ref1' with a task `t1' :

 
$ dio87c ra ref1
$ dio87c rta ref1 t1
$ dio87c rtoa ref1 t1 add always
$

We create two exploitation days from the referential : one whose start time is older than time limit, and one which is more recent.

 
$ time
Tue Jan 25 16:02:28 CET 2005
$
$ dio87c rp ref1 "2005-01-01"
New day name : ref1_20050101
from referential : ref1
[...]
Termination
$
$ dio87c rp ref1 "2005-01-20"
New day name : ref1_20050120
from referential : ref1
[...]
Termination
$
$ dio87c xdl
ref1_20050101
ref1_20050120
$

The days which are created are `ref1_20050101' and `ref1_20050101'. We use the xdi command to print the value of the `auto purged' property :

 
$ dio87c xdi ref1_20050101
Start Time:     2005-01-01 00:00:00
[...]
Auto Purged:    false
$

The `auto purged' property is set to false. We'll not wait until midnight. We'll start the day deletion process by calling the xdk without arguments.

 
$ dio87c xdk
$ dio87c xdl
ref1_20050101
ref1_20050120
$

The `ref1_20050101' was not deleted because its `auto purged' property is set to false. Now, we use the xdsa commant to set the `auto purged' property to true :

 
$ dio87c xdsa ref1_20050101 true
$ dio87c xdsa ref1_20050120 true
$
$ dio87c xdi ref1_20050101
Day Name:       ref1_20050101
[...]
Auto Purged:    true
$

We call the xdk command without argument to start the day deletion process :

 
$ dio87c xdk
$
$ dio87c xdl
ref1_20050120
$

The day `ref1_20050101' was deleted because its `auto purged' property is set to true and its start time is older than the time limit.

The day `ref1_20050120' was not deleted because its start time is too recent : the time limit is not reached.

The xdsa command enables or disables the `auto purged' property of a day. The initial value of this property is copied from the referential which was used to create it.

When the `auto purged' property of a referential is set to true, all exploitation days which are created from this referential, are automatically deleted when the time limit is reached.

We change the value of the `auto purged' property of the referential with the rsa command. The parameters of this command are the name of the referential and two boolean values : the value of the `auto planned' (not used here), and the value of the `auto purged' property :

 
$ dio87c rsa ref1 true true
$
$ dio87c ri ref1
Referential Name:  ref1
Locked:            false
Auto Planned:      true
Auto Purged:       true
$

We can re-create the exploitation day `ref1_20050101' (rp command) et we'll check that the `auto purged' property of the exploitation day is set to true.

 
$ dio87c rp ref1 "2005-01-01"
New day name : ref1_20050101
from referential : ref1
[...]
Termination
$
$ dio87c xdi ref1_20050101
Day Name:     ref1_20050101
[...]
Auto Purged:  true
$

If we call the xdk command without arguments, this day is automatically deleted :

 
$ dio87c xdl
ref1_20050101
ref1_20050120
$
$ dio87c xdk
$
$ dio87c xdl
ref1_20050120
$

If you set to true the `auto planned' and the `auto purged' properties of a referential, you won't have to create and to delete exploitation days : every days at midnight, a new exploitation day will be created from this referential, and all exploitation day which are older than the time limit, will be deleted.


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

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