You can change either the retention time or the retained number of entries to enable automatic purging. By default, both are set to an indefinite retention time and number of entries. The time unit of milliseconds (ms), seconds (s), minutes (m), hours (h), days (d), or weeks (w), may be preceded by an integer to specify a quantity for that unit, such as "1 d", "52 w", etc. Once you configure the properties, the changes take effect immediately without the need for a server restart.
Note that the server will delete all of the soft-deleted entries according to the policy in effect. If the policy is changed while entries are in the process of being deleted, the new policy takes effect after the in-process batch of entries is deleted and applies to any remaining soft-deleted entries going forward according to the new policy.
Retrieve the name of the Soft Delete Policy in effect using the
dsconfig command. For this example, the Soft Delete
Policy is called
$ bin/dsconfig get-global-configuration-prop \ --property soft-delete-policy
Do one or both of the following:
- Run dsconfig to set the retention time for
$ bin/dsconfig set-soft-delete-policy-prop \ --policy-name default-soft-delete-policy \ --set "soft-delete-retention-time:52 w"
- Run dsconfig to set the retained number of
$ bin/dsconfig set-soft-delete-policy-prop \ --policy-name default-soft-delete-policy \ --set soft-delete-retain-number-of-entries:1000000
- Run dsconfig to set the retention time for soft-deleted entries.
The Soft Delete Policy must be assigned to the global configuration if it has
not been assigned yet.
$ bin/dsconfig set-global-configuration-prop \ --set soft-delete-policy:default-soft-delete-policy