The Bucket Cleanup plugin deletes cancelled buckets safely and asynchronously. Its page lives in the staff navigation as S3 Bucket Cleanup.
The staged flow
Every cancelled bucket moves through a state machine, driven by an hourly cron:
- Needs Lifecycle Approval — queued; nothing touched yet.
- Lifecycle Approved → Lifecycle Applied — the cron attaches a 1-day expiration rule and locks the bucket against new uploads. Contents start expiring after ~24h.
- Needs Deletion Approval — 25 hours after the rule was applied.
- Deletion Approved → Deleted — the cron force-removes the bucket. The audit record is kept.
- Aborted — the service was reactivated while in flight; the cleanup was cancelled and the bucket restored.
Cleanup mode (plugin Settings)
- Automatic — the cron approves both gates itself; a cancelled bucket is fully deleted after roughly 26 hours with no clicks.
- Admin approval — a staff member must approve the lifecycle step and, later, the final deletion. Approvals are audited (who and when; automatic approvals are labeled as such).
Queue page actions
- Status filter tabs with counts, plus per-row View for full history and notes.
- Approve Lifecycle / Approve Deletion — per-row quick actions or bulk via "With selected".
- Delete Now — on approved records only: runs the deletion immediately instead of waiting for the next cron pass. Strongly confirmed; permanent. Very large buckets are better left to the cron.
- Retry — a record that failed 5 times is skipped by the cron until you reset its failure counter.
- Delete Audit Records — prune finished (Deleted/Aborted) rows from the list.
The record detail page also shows ready-to-copy mc commands for manual recovery (they contain live credentials — treat with care).
Orphaned Buckets
The Orphaned Buckets page compares everything on a selected storage server against what Blesta knows (active services + queue records) in both directions: buckets on the server no service owns, and buckets Blesta expects that are missing on the server. Read-only — deletion always goes through the queue.
Safety properties
- Deletion is refused for any record whose service is no longer cancelled; reactivated services are aborted/re-provisioned automatically (see Service Lifecycle).
- A bucket that already disappeared on the server counts as successfully deleted.
- The queue table is never dropped on uninstall — the audit history survives.