# Delete Events by automatic maintenance

**URL:** <https://talk.getindico.io/t/delete-events-by-automatic-maintenance/793>\
**Category:** Administrators\
**Created:** [November 30, 2018, 7:57am UTC](https://talk.getindico.io/t/delete-events-by-automatic-maintenance/793 "2018-11-30T07:57:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkfz2018](https://talk.getindico.io/user_avatar/talk.getindico.io/dkfz2018/32/63_2.png) [@dkfz2018](https://talk.getindico.io/u/dkfz2018)\
**Post date:** [November 30, 2018, 7:57am UTC](https://talk.getindico.io/t/delete-events-by-automatic-maintenance/793/1 "2018-11-30T07:57:55Z")

</div>

Hello, is it possible to extend the automatic maintenance so that events are deleted 30 days after the date of the event ?

---

<div class="post-metadata">

**Author:** ![kolodzie](https://talk.getindico.io/user_avatar/talk.getindico.io/kolodzie/32/18_2.png) [@kolodzie](https://talk.getindico.io/u/kolodzie)\
**Post date:** [November 30, 2018, 8:09am UTC](https://talk.getindico.io/t/delete-events-by-automatic-maintenance/793/2 "2018-11-30T08:09:41Z")

</div>

Yes it is. You just need to specify a config option in `indico.conf` which is named `CATEGORY_CLEANUP`.  
From the docs:

```
CATEGORY_CLEANUP

This setting specifies categories where events are automatically
deleted a certain amount of days after they have been created.

For each entry, the key is the category id and the value the days
after which an event is deleted.

```

For example:

```
CATEGORY_CLEANUP = {
    1: 30
}

```

would configure `indico-celery` to remove events older than 30 days from category with id 2.

---

<div class="post-metadata">

**Author:** ![dkfz2018](https://talk.getindico.io/user_avatar/talk.getindico.io/dkfz2018/32/63_2.png) [@dkfz2018](https://talk.getindico.io/u/dkfz2018)\
**Post date:** [November 30, 2018, 8:15am UTC](https://talk.getindico.io/t/delete-events-by-automatic-maintenance/793/3 "2018-11-30T08:15:43Z")

</div>

i thought it just take the date of the creation of the event not the date the event start/end.

---

<div class="post-metadata">

**Author:** ![kolodzie](https://talk.getindico.io/user_avatar/talk.getindico.io/kolodzie/32/18_2.png) [@kolodzie](https://talk.getindico.io/u/kolodzie)\
**Post date:** [November 30, 2018, 8:17am UTC](https://talk.getindico.io/t/delete-events-by-automatic-maintenance/793/4 "2018-11-30T08:17:42Z")

</div>

But that is how it works. If an event from a specified category has been created e.g. 30 days ago, it will be deleted.

---

<div class="post-metadata">

**Author:** ![dkfz2018](https://talk.getindico.io/user_avatar/talk.getindico.io/dkfz2018/32/63_2.png) [@dkfz2018](https://talk.getindico.io/u/dkfz2018)\
**Post date:** [November 30, 2018, 9:27am UTC](https://talk.getindico.io/t/delete-events-by-automatic-maintenance/793/5 "2018-11-30T09:27:30Z")

</div>

okay but for exabloe that will also delet events which are created 30 days ago but the event itself will start in 2 months later. So i will delete old events by hand then until it get maybe improved in the future in indico.

---

<div class="post-metadata">

**Author:** ![ThiefMaster](https://talk.getindico.io/user_avatar/talk.getindico.io/thiefmaster/32/509_2.png) [@ThiefMaster](https://talk.getindico.io/u/ThiefMaster)\
**Post date:** [November 30, 2018, 9:30am UTC](https://talk.getindico.io/t/delete-events-by-automatic-maintenance/793/6 "2018-11-30T09:30:46Z")

</div>

you could add a custom version of the cleanup task in a plugin and use that instead of the built-in one
