Consolidate backup storage to single mongo-backup directory

- Unify all backup scripts to use ./mongo-backup/ directory
- Update db-backup--standalone.sh to store volume backups in mongo-backup/
- Update db-backup--swarm.sh to use mongo-backup as default directory
- Update db-restore-from-backup--swarm.sh to look in mongo-backup/
- Update all header comments and documentation to reflect new location
- Update .gitignore to ignore both backups/ and mongo-backup/
- Update README.md with consolidated backup directory paths

This simplifies backup management by having all backup types in one location.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-26 11:20:29 +01:00
parent ba2a278d7e
commit 2375c1a193
5 changed files with 16 additions and 14 deletions

View File

@@ -42,7 +42,7 @@ The project includes multiple backup strategies for different deployment scenari
- `db-backup--standalone.sh` - Creates offline backup of the complete mongo-volume directory
- Database container is stopped during backup for consistency
- Backs up the entire MongoDB data directory
- Output: `./backups/mongo-volume-backup-YYYY-MM-DD-HH-MM.tar.gz`
- Output: `./mongo-backup/mongo-volume-backup-YYYY-MM-DD-HH-MM.tar.gz`
- Default retention: 7 backups (configurable via `KEEP` env var)
- Usage: `./db-backup--standalone.sh` or `KEEP=2 ./db-backup--standalone.sh`
@@ -50,7 +50,7 @@ The project includes multiple backup strategies for different deployment scenari
- `db-backup--swarm.sh` - Creates offline backup by scaling down the MongoDB service
- Service is scaled to 0 during backup
- Output: `./backups/mongo-volume-backup-YYYY-MM-DD-HH-MM.tar.gz`
- Output: `./mongo-backup/mongo-volume-backup-YYYY-MM-DD-HH-MM.tar.gz`
- Usage: `./db-backup--swarm.sh`
- `db-restore-from-backup--swarm.sh` - Restores volume backup by scaling down the service
@@ -75,13 +75,13 @@ Backups run automatically via cron at 04:00 every day:
- **Monday-Saturday**: Online database dumps without downtime (keeps 7 days of incremental backups)
All backup operations are logged with timestamps:
- Volume backups: `./backups/db-backup-standalone.log`
- 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
- `./backups/` - Volume backup archives (full mongo-volume directory)
- `./mongo-backup/` - Volume backup archives (full mongo-volume directory)
- `./mongo-backup/` - Database dump archives (utility-bills database only)
Both directories are excluded from git via `.gitignore`.