Scheduling the CleanDatabase job

hello all, can anyone tell me what the correct syntax is to schedule the system job on a regular basis via the xml configuration files? I do not find a clear answer on this in the documentation. I’ve tried using “SchedulingCleanDataBaseSetting” but that doesn’t seem to work. Any thoughts on this?

Kind regards,

Wim

Hello Wim,

I’m not sure if on SaaS they have it already configured automatically in the background and if this “SchedulingCleanDataBaseSetting” option is to override the SaaS one.

But you can make a specific job for it and add the crontab to it.

<Job Identifier="CleanDatabase" DisplayName_L1="Clean Database" CronTabExpression="*/15 * * * *" CronTimeZone="ServerTime">

  <CleanDataBase Identifier="CleanDatabase_CleanDataBase" DisplayName_L1="Clean Database" DisplayName_L2="Nettoyage de la base de données" Level="0" />

</Job>

Hello Wim,
in addition to Kamil’s response.

:globe_with_meridians: Crontab parameters:

  1. The NIM scheduler parameter uses Crontab parameters: Migrating Job Schedules to Scan Schedules | Netwrix Product Documentation.

  1. Don’t omit to activate the scheduler before restarting the IIS server: Application Settings | Netwrix Product Documentation

:writing_hand: Examples:

  1. Example for a Notification Job

<Job Identifier=“Job_SendNotif” DisplayName_L1=“05: Launch of Notifications/Reminders” DisplayName_L2=“05: Lancement des Notifications/Relances” Agent=“Local” CronTabExpression=“30 7 * * 1-5” CronTimeZone=“ServerTime”>

“At 07:30 on every day-of-week from Monday through Friday.”

  1. Example for the Clean Job status:

<SchedulingCleanDataBaseSetting CronTabExpression=“0 2 * * 1-6”/>

“At 02:00 on every day-of-week from Monday through Saturday.”

:light_bulb: Tip:

To set up a crontab file, I like to use a simple website Crontab.guru that lets me check the configuration in plain language, and then I copy and paste the generated text into my configuration file.

Does that help you configure it better?

Géraud

hello Kamil, so this is basically the xml that is generated by the scaffolding ‘CleanDatabaseJob’’ but adding a crontab to it? I previously tried to schedule it instead with ‘SchedulingCleanDataBaseSetting’. It is supposed to override the default values (whatever that is) but it doesn’t seem to work. I’ll try without the override option now.

Wim

hello Géraud,

the override option ‘SchedulingCleanDataBaseSetting’ doesn’t seem to be doing much. I myself ask Co-pilot to generate the crontab expression that I need, which works just fine. Thanks for the feedback.

Wim

hello Kamil, I’ve tried your suggested solution (I scheduled a daily execution) but nothing seems to have happened over the weekend. I don’t see any automatically executed job.

Wim

Hello Wim,

If you already declared the CleanDatabase job (<CleanDatabaseJob />), you can try something like this:

<Job Identifier="CleanDatabase" ConsolidationMode="Merge" CronTabExpression="0 6 * * *" CronTimeZone="ServerTime" Agent="XXXX" />

Cyril

Using ConsolidationMode=“Merge” is indeed better.
It seems that creating a job with the CleanDataBase task will terminate itself.
So you need to use the scaffolding CleanDatabaseJob.