Skip to content

Add EMAIL_ONLY_ON_DELETIONS option to WordPress backup cleanup - #26

Merged
locus313 merged 1 commit into
mainfrom
email-only-on-deletions
Aug 28, 2026
Merged

Add EMAIL_ONLY_ON_DELETIONS option to WordPress backup cleanup#26
locus313 merged 1 commit into
mainfrom
email-only-on-deletions

Conversation

@locus313

Copy link
Copy Markdown
Collaborator

Summary

Adds an EMAIL_ONLY_ON_DELETIONS environment variable to remove-wordpress-backups.sh so the email report is only sent when at least one backup was actually deleted. Skips the report when nothing was eligible, avoiding daily noise from runs that just show "0 backups removed". Dry-run and failure emails are unaffected — those still need eyes on them.

Usage

EMAIL_ONLY_ON_DELETIONS=true EMAIL_TO="admin@example.com" ./remove-old-wordpress-backups/remove-wordpress-backups.sh

Default is false (unchanged behavior — email sent on every run when EMAIL_TO is set).

Skips the email report when no backups were eligible for deletion,
avoiding daily noise from runs that only show "0 backups removed".
Dry-run and error emails are unaffected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@locus313
locus313 merged commit 94fb575 into main Aug 28, 2026
1 check passed
@locus313
locus313 deleted the email-only-on-deletions branch August 28, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant