Automated Deletion
This tutorial guides you through the process of setting collection states to Active, Closed or MarkedForDeletion, and configuring the grace period and execution interval/time for the deletion job via Helm.
Setting Collection State
To manage the lifecycle of collections, you can set their state to Active, Closed or MarkedForDeletion. The state can be set when a collection is created or updated via the REST APIs.
- Active: Indicates that the collection is currently active and can be changed.
- Closed: Indicates that the collection is no longer Active but not yet marked for deletion. Changes for this collection are not allowed via UI, but only via REST APIs.
- MarkedForDeletion: Indicates that the collection is scheduled for deletion after the grace period. Changes for this collection are not allowed via UI, but only via REST APIs.
When a collection is deleted, only the collection and everything stored within it (bookmarks, annotations, page order, brightness, rotation, etc.) are deleted. The original documents themselves are not deleted.
Configuring Automated Deletion via Helm
You can configure the grace period and the execution interval/time for the deletion job using Helm. Below is an example Helm configuration:
jobs:
deletion:
enabled: false # Set to true to enable the deletion job
cron: "0 0 0 * * ?" # Default cron expression for nightly deletion at midnight
gracePeriodInDays: 1 # Default grace period of 1 day
- enabled: Enables or disables the deletion job.
- cron: Specifies the cron expression for scheduling the deletion job. The default value
0 0 0 * * ?
schedules the job to run every day at midnight. - gracePeriodInDays: Specifies the number of days a collection must be marked for deletion before it is actually deleted. The default value is 1 day.
Example Usage
To enable the deletion job and set a custom schedule, modify the Helm values as needed. For instance, to run the deletion job every Friday at midnight with a grace period of 7 days:
jobs:
deletion:
enabled: true
cron: "0 0 0 * * FRI"
gracePeriodInDays: 7