# 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=0 # Monthly backups retention (default: 365 days = 12 months) # How long to keep monthly backups before deletion MONTHLY_RETENTION=0 # 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=7 # Weekly backup count limits (default: 4) # Maximum number of weekly backups to keep (newest ones) WEEKLY_COUNT_LIMIT=4 # Monthly backup count limits (default: 12) # Maximum number of monthly backups to keep (newest ones) MONTHLY_COUNT_LIMIT=12 # Pre-restore backup count limits (default: 5) # Maximum number of pre-restore backups to keep (newest ones) PRE_RESTORE_COUNT_LIMIT=5 # Storage snapshot count limits (default: 3) # Maximum number of storage snapshots to keep (newest ones) SNAPSHOT_COUNT_LIMIT=3 # ============================================================================= # DISK SPACE MANAGEMENT # These settings control when cleanup is automatically triggered # ============================================================================= # Disk usage warning threshold (default: 85%) # Send warning emails and trigger cleanup when disk usage exceeds this percentage DISK_WARNING_THRESHOLD=85 # Disk usage critical threshold (default: 95%) # Force aggressive cleanup when disk usage exceeds this percentage DISK_CRITICAL_THRESHOLD=95 # ============================================================================= # 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 # # =============================================================================