InTouch Hub · Blue Isle Software

S3 Cleanup

Delete S3 objects older than N days from a bucket prefix. Configurable retention; dry-run mode prints what would be deleted without removing. Daily summary of bytes freed.

Provided free and as is, without warranty of any kind — including merchantability, fitness for a particular purpose, and the accuracy or completeness of any result. See the licence. You are responsible for checking what this produces before relying on it.

accesscleanupclouddevopsidentityit-supportlogmanagementmessagenotificationpipelineruntimeenvschedulesummary

s3-cleanup

Delete S3 objects older than N days from a bucket prefix. Daily summary of bytes freed. Dry-run mode for the first few runs so you can preview without accidentally nuking anything.

Use case

S3 buckets accumulate. Build artifacts, log dumps, temp files, expired exports — they sit there forever and quietly cost money. S3 Lifecycle Policies handle this in theory, but they're a pain to author for one-off cases and they apply silently with no notification. This workflow runs daily, deletes by age, and emails you a one-line summary so you know it ran and what it cleaned.

This is a InTouch workflow, not a skill — pure plumbing, no AI value.

Setup

  1. Create an aws credential with s3:ListBucket, s3:DeleteObject, and s3:GetObject on the target bucket
  2. Edit workflow.iml:
  3. BUCKET — your bucket name (no s3:// prefix)
  4. PREFIX — path inside the bucket (trailing slash matters; empty string = whole bucket)
  5. RETENTION_DAYS — anything older than this gets deleted
  6. DRY_RUN1 for first runs (preview only), then flip to 0 once you trust it
  7. Schedule daily (or weekly for low-churn buckets)

Pipeline

  1. cleanupruntimeenv (bash + AWS CLI) — lists, filters by LastModified, deletes (or previews)
  2. notifymessage — sends the summary

Safety notes

Customization

Source

See workflow.iml.