Purge Expired Data Recurring Task

Note: this component is designated "advanced", which means that objects of this type are not expected to be created or altered in most environments. If you believe that such a change is necessary, you may want to contact support in order to understand the potential impact of that change.

Instances of the Purge Expired Data Recurring Tasks can be used to schedule purge runs at specific wall-clock times via the task scheduler, which is restart-safe and time-anchored. Each scheduled execution performs a complete purge pass, looping through all batches until no expired entries remain.

Data that should be deleted is identified by the datetime-attribute property and optionally the datetime-json-field property. The values stored in the attribute or field can either represent an expiration time or a creation time with the expiration-offset property defining how long before the data expires.

Unlike the Purge Expired Data Plugin, which uses an interval-based polling loop, the Purge Expired Data Recurring Task runs a complete purge pass each time it is scheduled and then completes. Use the task scheduler to control when purges run.

Direct Subcomponents Parent Component Properties dsconfig Usage

Direct Subcomponents

The following Purge Expired Data Recurring Tasks are available in the server :

These Purge Expired Data Recurring Tasks inherit from the properties described below.

Parent Component

The Purge Expired Data Recurring Task component inherits from the Recurring Task

Properties

The properties supported by this managed object are as follows:


Basic Properties: Advanced Properties:
 description  None
 cancel-on-task-dependency-failure
 email-on-start
 email-on-success
 email-on-failure
 alert-on-start
 alert-on-success
 alert-on-failure
 datetime-attribute
 datetime-json-field
 datetime-format
 custom-datetime-format
 custom-timezone
 expiration-offset
 purge-behavior
 base-dn
 filter
 max-updates-per-second
 num-delete-threads

Basic Properties

description

Description
A description for this Recurring Task
Default Value
None
Allowed Values
A string
Multi-Valued
No
Required
No
Admin Action Required
None. Modification requires no further action

cancel-on-task-dependency-failure

Description
Indicates whether an instance of this Recurring Task should be canceled if the task immediately before it in the recurring task chain fails to complete successfully (including if it is canceled by an administrator before it starts or while it is running). If this is true, then the instance of this Recurring Task will also be considered a failure (with a state of "canceled before starting"), and if that instance is itself a dependency for any other Recurring Task instance, then that dependent task's cancel-on-task-dependency-failure property will be used to determine whether it should be canceled or preserved.
Default Value
false
Allowed Values
true
false
Multi-Valued
No
Required
No
Admin Action Required
None. Modification requires no further action

email-on-start

Description
The email addresses to which a message should be sent whenever an instance of this Recurring Task starts running. If this option is used, then at least one smtp-server must be configured in the global configuration.
Default Value
No email message will be sent when instances of this Recurring Task start running.
Allowed Values
A string
Multi-Valued
Yes
Required
No
Admin Action Required
None. Modification requires no further action

email-on-success

Description
The email addresses to which a message should be sent whenever an instance of this Recurring Task completes successfully. If this option is used, then at least one smtp-server must be configured in the global configuration.
Default Value
No email message will be sent when instances of this Recurring Task finish running.
Allowed Values
A string
Multi-Valued
Yes
Required
No
Admin Action Required
None. Modification requires no further action

email-on-failure

Description
The email addresses to which a message should be sent if an instance of this Recurring Task fails to complete successfully. If this option is used, then at least one smtp-server must be configured in the global configuration.
Default Value
No email message will be sent when instances of this Recurring Task fail to complete successfully.
Allowed Values
A string
Multi-Valued
Yes
Required
No
Admin Action Required
None. Modification requires no further action

alert-on-start

Description
Indicates whether the server should generate an administrative alert whenever an instance of this Recurring Task starts running.
Default Value
false
Allowed Values
true
false
Multi-Valued
No
Required
No
Admin Action Required
None. Modification requires no further action

alert-on-success

Description
Indicates whether the server should generate an administrative alert whenever an instance of this Recurring Task completes successfully.
Default Value
false
Allowed Values
true
false
Multi-Valued
No
Required
No
Admin Action Required
None. Modification requires no further action

alert-on-failure

Description
Indicates whether the server should generate an administrative alert whenever an instance of this Recurring Task fails to complete successfully.
Default Value
true
Allowed Values
true
false
Multi-Valued
No
Required
No
Admin Action Required
None. Modification requires no further action

datetime-attribute

Description
The LDAP attribute that determines when data should be deleted. This could store the expiration time, or it could store the creation time and the expiration-offset property specifies the duration before data is deleted. If datetime-attribute stores only a date or timestamp value (i.e., it is not a JSON attribute), then this attribute must be indexed for "ordering" to allow efficient searches. Alternatively, a Local DB Composite Index can be created with an index-filter-pattern of '(x=?)' where 'x' is the value of this property.

If the expiration is tracked in a JSON field within this attribute, the datetime-json-field property must be set, and the server must be configured with a JSON Attribute Constraint for this attribute along with a JSON Field Constraint for the configured datetime-json-field with index-values=true.

Default Value
None
Allowed Values
The name or OID of an attribute type defined in the server schema.
Multi-Valued
No
Required
Yes
Admin Action Required
None. Modification requires no further action

datetime-json-field

Description
The top-level JSON field within the configured datetime-attribute that determines when data should be deleted. This could store the expiration time, or it could store the creation time and the expiration-offset property specifies the duration before data is deleted. The server must be configured with a JSON Attribute Constraint for the datetime-attribute along with a JSON Field Constraint for the datetime-json-field, which includes index-values=true to allow efficient searches.
Default Value
None
Allowed Values
A string
Multi-Valued
No
Required
No
Admin Action Required
None. Modification requires no further action

datetime-format

Description
Specifies the format of the datetime stored within the entry that determines when data should be purged.
Default Value
generalized-time
Allowed Values
generalized-time - The datetime value is specified in Generalized Time format (e.g., 20071217170000Z). This is the standard time format within LDAP, and is used by attributes such as createTimestamp. Attributes configured with generalizedTimeOrderingMatch can be stored with any time zone offset. For timestamps stored in attributes with a string matching rule or stored in JSON fields, the time zone must be UTC.

java-system-time-millis - The datetime value is consistent with what is returned by java.lang.System.currentTimeMillis().

rfc-3339 - The datetime value is stored in RFC 3339 format (e.g., 2026-05-11T01:23:45.678Z).

custom - The format of the datetime value is specified using the custom-datetime-format field.
Multi-Valued
No
Required
Yes
Admin Action Required
None. Modification requires no further action

custom-datetime-format

Description
When the datetime-format property is configured with a value of "custom", this specifies the format (using a string compatible with the java.text.SimpleDateFormat class) that will be used to search for expired data. Since the task uses range searches to search for expired data, the lexicographical ordering of two formatted timestamp values must be consistent with their actual order. In particular, timestamps must be arranged so that components are ordered from least specific to most specific (i.e., year before month, month before day, day before hour, etc.), they must only use numeric representations of those components (e.g, the number 12 to represent the month instead of a string like "December" or "Dec"), and each component must use a consistent number of digits (i.e., four digits for the year, two digits for the month, two digits for the day, etc., with single-digit numbers padded with leading zeroes). For instance, the ISO 8601 format, "yyyy-MM-dd'T'HH:mm:ssZ", meets this requirement, but a format that puts the day of the month first, "dd/MM/yyyy HH:mm:ssZ", does not.
Default Value
None
Allowed Values
A string
Multi-Valued
No
Required
No
Admin Action Required
None. Modification requires no further action

custom-timezone

Description
Specifies the time zone to use when generating a date string using the configured custom-datetime-format value. The provided value must be accepted by java.util.TimeZone.getTimeZone.
Default Value
GMT
Allowed Values
A string
Multi-Valued
No
Required
No
Admin Action Required
None. Modification requires no further action

expiration-offset

Description
The duration to wait after the value specified in datetime-attribute (and optionally datetime-json-field) before purging the data. For example, if the configured datetime-attribute stores an expiration time, then specifying a value here of "5m" will purge the data that expired five minutes before the task runs. If the configured datetime-attribute stores a creation time (e.g., createTimestamp), then expiration-offset should store the duration of time before the data should be purged.
Default Value
None
Allowed Values
A duration. Lower limit is 0 milliseconds.
Multi-Valued
No
Required
Yes
Admin Action Required
None. Modification requires no further action

purge-behavior

Description
Specifies whether to delete expired entries or attribute values. By default entries are deleted.
Default Value
None
Allowed Values
delete-entries - Matched entries are expired and should be deleted. If a matching entry has subordinate entries, it will only be deleted if all of its subordinates also have expired timestamp values in accordance with the criteria defined for this task. However, non-leaf entries will not be deleted if they have any subordinate entries without a timestamp, with a non-expired timestamp, or that do not otherwise match the criteria defined for this task.

subtree-delete-entries - Matched entries and the subtrees beneath them in the LDAP hierarchy are expired and should be deleted. Subtrees must be smaller than the configured value of subtree-delete-size-limit on the Local DB Backend, which has a default of 5000.

delete-json-attribute-values - Only matched attribute values are expired and should be deleted. This only applies to attributes with the JSONObject syntax and requires that datetime-json-field is also configured.
Multi-Valued
No
Required
Yes
Admin Action Required
None. Modification requires no further action

base-dn

Description
Only entries located within the subtree specified by this base DN are eligible for purging. In servers configured with multiple Local DB Backends and only one backend with data that should be purged, this property can be set to reduce what data is searched. This can make the task execute more efficiently, and it reduces the indexing requirements in the other backends.
Default Value
Entries in all Local DB Backends are eligible for purging.
Allowed Values
A valid DN.
Multi-Valued
No
Required
No
Admin Action Required
None. Modification requires no further action

filter

Description
Only entries that match this LDAP filter will be eligible for having data purged. By default this task searches for entries with expired data based only on the datetime-attribute and datetime-json-field if one is specified. However, setting this filter property can restrict that to only a subset of entries.

For example, if OAuth token entries should be deleted one day after they were created, then this task could be configured with datetime-attribute=createTimestamp, expiration-offset=1d, and filter=(objectclass=oauthToken).

Default Value
Entries of all types are eligible for purging.
Allowed Values
A valid LDAP search filter
Multi-Valued
No
Required
No
Admin Action Required
None. Modification requires no further action

max-updates-per-second

Description
This setting smooths out the performance impact on the server by throttling the purging to the specified maximum number of updates per second. To avoid a large backlog, this value should be set comfortably above the average rate that expired data is generated. When purge-behavior is set to subtree-delete-entries, then deletion of the entire subtree is considered a single update for the purposes of throttling.
Default Value
100
Allowed Values
An integer value. Lower limit is 1.
Multi-Valued
No
Required
Yes
Admin Action Required
None. Modification requires no further action

num-delete-threads

Description
The number of threads used to delete expired entries or JSON attribute values. By default, expired entries will be deleted in a single thread, and this is the recommended configuration for most deployments. However, multiple threads may be needed if expired entries accumulate faster than a single thread can delete them.
Default Value
None
Allowed Values
An integer value. Lower limit is 1.
Multi-Valued
No
Required
No
Admin Action Required
None. Modification requires no further action


dsconfig Usage

To list the configured Recurring Tasks:

dsconfig list-recurring-tasks
     [--property {propertyName}] ...

To view the configuration for an existing Recurring Task:

dsconfig get-recurring-task-prop
     --task-name {name}
     [--tab-delimited]
     [--script-friendly]
     [--property {propertyName}] ...

To update the configuration for an existing Recurring Task:

dsconfig set-recurring-task-prop
     --task-name {name}
     (--set|--add|--remove) {propertyName}:{propertyValue}
     [(--set|--add|--remove) {propertyName}:{propertyValue}] ...

To create a new Purge Expired Data Recurring Task:

dsconfig create-recurring-task
     --task-name {name}
     --type purge-expired-data
     --set datetime-attribute:{propertyValue}
     --set expiration-offset:{propertyValue}
     --set purge-behavior:{propertyValue}
     [--set {propertyName}:{propertyValue}] ...

To delete an existing Recurring Task:

dsconfig delete-recurring-task
     --task-name {name}