Snapshot of main at 9f39a6e1e (2026-11-02)

This commit is contained in:
Ronald Huynen committed 2026-11-02 10:41:47 +01:00
commit 6ccf1792d7
2580 files changed
+1040202

No files matched your search

+145
View File
@@ -0,0 +1,145 @@
# Timebank Backup Retention Policy Configuration
#
# This file controls how long different types of backups are kept before being automatically cleaned up.
#
# IMPORTANT NOTES:
# - Values are in days unless otherwise specified
# - Changes take effect immediately on next cleanup run
# - Lower values = less storage used, shorter recovery window
# - Higher values = more storage used, longer recovery window
# - Test changes with --dry-run before applying
#
# Last updated: $(date)
# =============================================================================
# TIME-BASED RETENTION (in days)
# These policies delete backups older than the specified number of days
# =============================================================================
# Daily backups retention (default: 7 days)
# How long to keep daily backups before deletion
DAILY_RETENTION=3
# Weekly backups retention (default: 28 days = 4 weeks)
# How long to keep weekly backups before deletion
WEEKLY_RETENTION=28
# Monthly backups retention (default: 365 days = 12 months)
# How long to keep monthly backups before deletion
MONTHLY_RETENTION=365
# Pre-restore backups retention (default: 30 days)
# How long to keep automatic backups created before restore operations
PRE_RESTORE_RETENTION=14
# Log files retention (default: 30 days)
# How long to keep backup and cleanup log files
LOG_RETENTION=30
# =============================================================================
# COUNT-BASED RETENTION
# These policies keep only the N most recent backups of each type
# =============================================================================
# Daily backup count limits (default: 7)
# Maximum number of daily backups to keep (newest ones)
DAILY_COUNT_LIMIT=3
# Weekly backup count limits (default: 4)
# Maximum number of weekly backups to keep (newest ones)
WEEKLY_COUNT_LIMIT=2
# Monthly backup count limits (default: 12)
# Maximum number of monthly backups to keep (newest ones). Applies to the
# database dumps, and to storage archives unless STORAGE_MONTHLY_COUNT_LIMIT
# is set.
MONTHLY_COUNT_LIMIT=3
# Monthly STORAGE archives only (default: MONTHLY_COUNT_LIMIT). Each is a
# ~490MB copy of storage/ that barely differs from the next, while a monthly
# database dump is ~5MB: keep three months of database history but only the
# latest storage archive. Cut from 3 on 2026-10-07 to free disk (~1GB).
STORAGE_MONTHLY_COUNT_LIMIT=1
# Pre-restore backup count limits (default: 3)
# Maximum number of pre-restore backups to keep (newest ones)
# Kept low: multiple restores in one day can quickly create many files
PRE_RESTORE_COUNT_LIMIT=3
# Storage snapshot count limits (default: 3)
# Maximum number of storage snapshots to keep (newest ones)
SNAPSHOT_COUNT_LIMIT=3
# Whole-storage archives (backups/storage/full). These are the largest single
# files in the tree, and had no cleanup rule at all before 2026-09-22.
# Cut from 2 to 1 on 2026-10-07 (~490MB): the daily, weekly and monthly
# archives already hold several older copies of the same storage.
FULL_COUNT_LIMIT=1
FULL_RETENTION=14
# =============================================================================
# DISK SPACE MANAGEMENT
# These settings control when cleanup is automatically triggered
# =============================================================================
# Disk usage warning threshold (default: 80%)
# Send warning emails and trigger cleanup when disk usage exceeds this percentage
DISK_WARNING_THRESHOLD=75
# Disk usage critical threshold (default: 95%)
# Force aggressive cleanup when disk usage exceeds this percentage
DISK_CRITICAL_THRESHOLD=85
# =============================================================================
# EMAIL NOTIFICATION SETTINGS
# =============================================================================
# Email address for backup notifications (optional)
# If not set, defaults to $USER@localhost
# BACKUP_NOTIFY_EMAIL=admin@yourdomain.org
# Enable/disable email notifications (default: true)
# Set to false to disable all email notifications from cleanup script
EMAIL_NOTIFICATIONS_ENABLED=true
# =============================================================================
# ADVANCED SETTINGS
# =============================================================================
# Cleanup mode (default: both)
# Options: age_only, count_only, both
# - age_only: Only use time-based retention
# - count_only: Only use count-based retention
# - both: Use both methods (recommended for safety)
CLEANUP_MODE=both
# Empty directory cleanup (default: true)
# Whether to remove empty backup directories after file cleanup
CLEANUP_EMPTY_DIRS=false
# Backup verification before deletion (default: false)
# Set to true to verify backup integrity before deletion (slower but safer)
VERIFY_BEFORE_DELETE=false
# =============================================================================
# CONFIGURATION EXAMPLES
# =============================================================================
#
# Conservative (longer retention):
# DAILY_RETENTION=14
# WEEKLY_RETENTION=56 # 8 weeks
# MONTHLY_RETENTION=730 # 2 years
#
# Aggressive (shorter retention, less storage):
# DAILY_RETENTION=3
# WEEKLY_RETENTION=14 # 2 weeks
# MONTHLY_RETENTION=180 # 6 months
#
# Space-constrained environment:
# DAILY_COUNT_LIMIT=3
# WEEKLY_COUNT_LIMIT=2
# MONTHLY_COUNT_LIMIT=6
# DISK_WARNING_THRESHOLD=75
# DISK_CRITICAL_THRESHOLD=85
#
# =============================================================================