Delete Old Exports Without Deleting the Source Contacts

Delete Old Exports Without Deleting the Source Contacts

MailBolt
MailBolt™ Team
Author
2026-10-29
Published
1 min read
Reading Time

An exports folder grows indefinitely because nobody is sure which files are safe to remove. Separate generated artifacts from the records needed to run the service.

Give each artifact a lifecycle

Record when an export was generated, its owner, purpose and expiry. Keep it in a dedicated private location rather than mixing it with the canonical contact store. Apply your existing retention policy to the right class of data.

Do not infer safety only from an old modification time. A file may be part of an unfinished operation or the only copy of an important recovery record. Identify its role first.

Make cleanup bounded and observable

Use a small maintenance batch that skips active jobs and reports counts without dumping personal content. Test it on fictional files representing expired, recent, active and unknown items. Unknown data should be reviewed rather than deleted optimistically.

Confirm that deleting an expired download leaves the underlying contacts and subscription history intact. Also ensure that an old public link no longer retrieves the file after its intended expiry.

Cleanup is safer when the storage layout explains what each file is for. An anonymous pile of JSON and CSV files invites mistakes.

MailBolt
Written by
MailBolt™ Team