Introduction

These options allow you to configure a snapshot retention policy for all applications managed by Console.

  • All options are disabled out of the box.
  • If you are using embedded Dashboards, the dashboard data will be cleaned up when a snapshot is deleted.

≥ 2.6

It is only possible to choose one of the two strategies available, either Control the number of snapshots OR Filter on snapshot name. Choosing one will disable the settings made in the other.

Control the number of snapshots

Keep minimum X snapshot(s)This option allows you to configure a minimum number of snapshots to retain for any given Application managed in Console.
Keep maximum X snapshot(s)This option allows you to configure a maximum number of snapshots to retain for any given Application managed in Console.
Delete the snapshots if they are older than X day(s)This option allows you to configure a retention policy that will delete any snapshot for any Application that is older than X number of days.

Option priority

All three options can be used in conjunction. The order of priority when multiple options are active is as follows:

  • Keep minimum X snapshot(s) per application
  • Delete the snapshots if they are older than X day(s)
  • Keep maximum X snapshot(s) per application

Therefore priority is given to ensuring that the minimum number of snapshots is always retained (if this option is enabled), even if those snapshots might be older than the number of days specified in the option Delete the snapshots if they are older than X day(s).

Filter on snapshot name

Remove snapshots with a name that contains

These options allow you to remove or retain any snapshot for any given Application managed in Console whose name matches a string entered in the field to the right:

Snapshot names can be viewed in the Application - Snapshots panel.

Keep only snapshots with a name that contains

Schedule

If any of these options are enabled, a scheduled task will be run every weekday at 2300 to identify if any snapshots must be deleted for an application. This task will first identify if there are snapshots to be removed and then launch a snapshot cleanup job if required, which will be responsible for removing the snapshots and cleaning any data linked to this snapshot in the CAST Storage Service/PostgreSQL instance.

Note that this cleanup job is responsible for cleaning up both snapshots and versions (see the equivalent option for versions Administration Center - Settings - Version Strategy).

If you want to set an alternative date/time/frequency for the scheduled task you can use the Schedule button:

You can choose a date/time using the UI:

Or you can set a date/time using the custom option which requires a cron expression which requires six characters in this order:

  • seconds (0-59)
  • minutes (0-59)
  • hours (0-23)
  • date of the month (1-31)
  • month (1-12 or JAN-DEC)
  • days of the week (0-6 where Sunday=0 or 7, or SUN, MON, TUE, WED, THU, FRI, SAT, or range of days MON-FRI)

 For example to change to running the job at 1am on a Sunday:

Changes are shown in the main panel:

≤ 2.5

These options allow you to configure a snapshot retention policy for all applications managed by Console:

  • to retain snapshots for a specific number of days
  • or to retain a min or max number of snapshots per Application
Delete the snapshots if they are older than X day(s)Disabled by default. This option allows you to configure a retention policy that will delete any snapshot for any Application that is older than X number of days.
Keep minimum X snapshot(s) per applicationDisabled by default. This option allows you to configure a minimum number of snapshots to retain for any given Application.
Keep maximum X snapshot(s) per applicationDisabled by default. This option allows you to configure a maximum number of snapshots to retain for any given Application.

Option priority

All three options can be used in conjunction. The order of priority when multiple options are active is as follows:

  • Keep minimum X snapshot(s) per application
  • Delete the snapshots if they are older than X day(s)
  • Keep maximum X snapshot(s) per application

Therefore priority is given to ensuring that the minimum number of snapshots is always retained (if this option is enabled), even if those snapshots might be older than the number of days specified in the option Delete the snapshots if they are older than X day(s).

Cleanup job scheduling

If any of these parameters are enabled, a scheduled task will be run every weekday at 2300 to identify if any snapshots must be deleted for an application. This task will first identify if there are snapshots to be removed and then launch a snapshot cleanup job if required, which will be responsible for removing the snapshots and cleaning any data linked to this snapshot in the CAST Storage Service/PostgreSQL instance.

Note that this cleanup job is responsible for cleaning up both snapshots and versions (see the equivalent option for versions Administration Center - Settings - Version Strategy).

Modifying the job schedule

You can modify the timing of the cleanup job using the following .properties file - this file exists on each Node, therefore if you want the job schedule to run at the same time on all Nodes, you will need to make the same change on all Nodes:

%PROGRAMDATA%\CAST\AipConsole\AipNode\aip-node-app.properties

Find the following section:

# Cron configuration to run maintenance tasks on node, like snapshot and version cleanup tasks (defaults to running every weekday evening at 23h00)
# Note that no job will run if settings won't allow it
node.maintenance.cron=0 0 23 * * MON-FRI

Modify any of the six parameters that are listed in this order:

  • seconds (0-59)
  • minutes (0-59)
  • hours (0-23)
  • date of the month (1-31)
  • month (1-12 or JAN-DEC)
  • days of the week (0-6 where Sunday=0 or 7, or SUN, MON, TUE, WED, THU, FRI, SAT, or range of days MON-FRI)

For example to change to running the job at 1am on a Sunday:

# Cron configuration to run maintenance tasks on node, like snapshot and version cleanup tasks (defaults to running every weekday evening at 23h00)
# Note that no job will run if settings won't allow it
node.maintenance.cron=0 0 1 * * SUN

Save the file and restart the Node to ensure the change is taken into account.