> For the complete documentation index, see [llms.txt](https://community-test.logicnets.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://community-test.logicnets.com/release-9/platform-documentation/cron-job-scheduler/cron-job-clean-up-schedule.md).

# Cron Job Clean Up Schedule

As the Scheduler Monitor runs, it stores data in a related database. Over time, this database can grow very large and slow down functionality. To reduce the size of the database, the system cleans data out of the data base daily, removing data that is more than 7 days old by default.

The daily cleanup also removes login tokens that can no longer be used, including tokens of ended logins after 2 days and refresh tokens of connected apps once they have expired. The system removes stored tokens of external identity providers when no login uses them anymore and they were not used for the retention period (`_global.cleanup.retention_period` in the server settings, default 7 days). When tokens are stored in an external database (data source `__tokenmgnt`), the system cleans that database as well.

For large systems where many cronjobs run each day, you may want to reduce the retention period. For other systems you may want to keep the logs for longer.

To change the cleanup schedule add the following text to the system *settings.cfg* file located at *\dat\settings.cfg*. Note that a standard installation will not have this configuration setting already in place and you will need to add it.

The example shows the setting when cronjob files need to be kept for 1 day).

```
_session = {
    SCHEDULER = {
         retention_period = 1
                 }
         }
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://community-test.logicnets.com/release-9/platform-documentation/cron-job-scheduler/cron-job-clean-up-schedule.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
