From 982a8f0f8805fdd57be3caab345f473e6252d2d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=87?= Date: Wed, 26 Nov 2025 12:29:16 +0100 Subject: [PATCH] Update backup retention policy and documentation for clarity --- README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9c38412..e1e7312 100644 --- a/README.md +++ b/README.md @@ -66,25 +66,27 @@ Backups run automatically via cron at 04:00 every day: # Sunday: Full volume backup (offline), keep 2 backups 0 4 * * 0 cd /home/knee-cola/web-pro/evidencija-rezija && KEEP=2 ./db-backup--standalone.sh -# Monday-Saturday: Database dump (online), keep 7 backups -0 4 * * 1-6 cd /home/knee-cola/web-pro/evidencija-rezija && KEEP=7 ./db-dump--standalone.sh +# Monday-Saturday: Database dump (online), keep 6 backups +0 4 * * 1-6 cd /home/knee-cola/web-pro/evidencija-rezija && KEEP=6 ./db-dump--standalone.sh ``` **Backup Strategy:** -- **Sundays**: Full volume backup with brief downtime (keeps 2 weeks of full backups) -- **Monday-Saturday**: Online database dumps without downtime (keeps 7 days of incremental backups) +- **Sundays**: Full volume backup with brief downtime (keeps 2 full backups) +- **Monday-Saturday**: Online database dumps without downtime (keeps 6 daily backups) +- **Safety net**: The retention policy ensures that at any point you have 2 full backups plus the 6 daily dumps created between them. This provides up to 2 weeks to detect and recover from a corrupted or inconsistent full backup before losing the previous full backup and its associated daily dumps. All backup operations are logged with timestamps: - Volume backups: `./mongo-backup/db-backup-standalone.log` - Database dumps: `./mongo-backup/db-dump-db-standalone.log` - Restore operations: `./mongo-backup/db-restore-from-dump.log` -## Backup Directories +## Backup Directory -- `./mongo-backup/` - Volume backup archives (full mongo-volume directory) -- `./mongo-backup/` - Database dump archives (utility-bills database only) +All backups are stored in `./mongo-backup/`: +- Volume backups: `mongo-volume-backup-YYYY-MM-DD-HH-MM.tar.gz` (full mongo-volume directory) +- Database dumps: `utility-bills-dump-YYYY-MM-DD_HH-MM.tar.gz` (utility-bills database only) -Both directories are excluded from git via `.gitignore`. +This directory is excluded from git via `.gitignore`. # Deploying The deployment is done via Docker: