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
- Access the machine on which your combined Content Deployer or Content Deployer worker runs.
- Ensure that there is an environment variable called
statestorecleanupcronon this system, set to a time interval formatted as for a cron job. (Alternatively, you can also hardcode this interval as the value of thestate.store.cleanup.cronproperty 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:SECis at which second of the minute to perform the cleanup. This value can be 0-59, or * to mean every second of the minute.MINis at which minute of the hour to perform the cleanup. This value can be 0-59, or * to mean every minute of the hour.HOURis at which hour of the day to perform the cleanup. This value can be 0-23, or * to mean every hour of the day.MDAYis at which day of the month to perform the cleanup. This value can be 1-31, or * to mean every day of the month.MONTHis in which month of the year to perform the cleanup. This value can be 1-12, or * to mean every month of the year.WDAYis on which day of the week to perform the cleanup . This value is a three-letter all-caps string to identify the weekday (MON,TUEand so on), or * to mean every weekday.
- Ensure that there is an environment variable called
statestoreobsoleterecordsintervalon 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 thestate.store.obsolete.records.intervalproperty in the application.properties file.) This value must be 86400000 (that is, 1 day) or higher.