CleanupCron

The CleanupCron deletes old data from the database and cleans up the application's temporary files. It iterates over a list of tables defined in its parameters and, for each table, deletes records older than a configured number of days.

Overview

Property

Value

Purpose

Deletes old data from the database and cleans up the application's temporary files

Default schedule

00 23 1 1 * * (once a year, on January 1 at 23:00)

Timeout

60 minutes

The schedule can be changed in the cron administration.

What the cron deletes

The cron iterates over the list of tables defined in its parameters. For each table it deletes records older than keepDays days, up to a maximum of limit records per run.

Table

Default keepDays

Default limit

Note

PERFORMANCE_LOGS

730

1,000

Performance logs

EVENT_PARAM

730

1,000

Event parameters

CRON_RUNS

730

1,000

Cron run history (only records in FINISHED state)

DMS_FILE_ACCESS_LOG

730

1,000

DMS file access logs

MAIL_QUEUE

730

1,000

E-mail queue (only e-mails in state D – delivered)

AI_LLM_TOOL_CALL

180

5,000

AI tool call records

AI_LLM_RUN

180

5,000

LLM run records

AI_USER_ACTION_REQUEST

180

5,000

AI user action requests

AI_CONVERSATION_MEMORY

360

5,000

AI conversation memory

AI_MESSAGE

360

5,000

AI conversation messages

AI_AGENTIC_WORKFLOW

360

1,000

AI agentic workflows

AI_CONVERSATION

360

1,000

AI conversations

In addition to the database tables, the cron also clears and recreates the application's temporary folders (tmp subdirectories). This behavior is controlled by the cleanupTmp parameter.

Parameter configuration

The cron parameters are provided as a JSON object. Example of the default configuration:

{
"tables": [
{ "name": "PERFORMANCE_LOGS", "keepDays": 730, "limit": 1000 },
{ "name": "MAIL_QUEUE", "keepDays": 730, "limit": 1000, "processStatuses": ["D"] },
{ "name": "AI_LLM_RUN", "keepDays": 180, "limit": 5000 }
],
"cleanupTmp": true
}

Table parameters

Parameter

Required

Description

name

Yes

Table name (see the list above)

keepDays

Yes

Records older than this number of days will be deleted

limit

Yes

Maximum number of rows deleted per run

processStatuses

No

Record status filter (for MAIL_QUEUE only, value ["D"])

The cleanupTmp parameter

Value

Behavior

true (default)

The application's temporary folders are cleared and recreated

false

The temporary folders are skipped

Recommendation: Reset the cron parameters to their default values regularly. This ensures that newly added tables are automatically included in the retention policy.

Editing the configuration in administration

  1. Go to Administration → Crons.
  2. Find the cron Cleanup old data from Database and from other parts of app.
  3. Edit the JSON in the Parameters field as needed (change keepDays, limit, or remove/add tables from the list).
  4. Save and optionally run it manually.

Frantisek Brych Updated by Frantisek Brych

Parallel cron - PostponedTaskCron

Crons

Contact

Syca (opens in a new tab)

Powered by HelpDocs (opens in a new tab)