Documentation Center

Scheduling a periodic cleanup of the State Store database

To prevent the State Store database (used by Content Deployer) from growing too large, schedule a periodic cleanup.

Procedure

  1. Access the machine on which your combined Content Deployer or Content Deployer worker runs.
  2. Ensure that there is an environment variable called statestorecleanupcron on this system, set to a time interval formatted as for a cron job. (Alternatively, you can also hardcode this interval as the value of the state.store.cleanup.cron property in the application.properties file, located in the configuration location of your combined Content Deployer or Content Deployer worker.)
    The cron job interval format is: "SEC MIN HOUR MDAY MONTH WDAY" where:
    • SEC is at which second of the minute to perform the cleanup. This value can be 0-59, or * to mean every second of the minute.
    • MIN is at which minute of the hour to perform the cleanup. This value can be 0-59, or * to mean every minute of the hour.
    • HOUR is at which hour of the day to perform the cleanup. This value can be 0-23, or * to mean every hour of the day.
    • MDAY is at which day of the month to perform the cleanup. This value can be 1-31, or * to mean every day of the month.
    • MONTH is in which month of the year to perform the cleanup. This value can be 1-12, or * to mean every month of the year.
    • WDAY is on which day of the week to perform the cleanup . This value is a three-letter all-caps string to identify the weekday (MON, TUE and so on), or * to mean every weekday.
  3. Ensure that there is an environment variable called statestoreobsoleterecordsinterval on this system, set to the amount of time in milliseconds after which a record in the State Store database may be considered obsolete (that is, eligible for cleanup). (Alternatively, you can also hardcode this interval as the value of the state.store.obsolete.records.interval property in the application.properties file.) This value must be 86400000 (that is, 1 day) or higher.