Implement a dedicated Docker container (backup-cron) for automated daily
backups and maintenance tasks, eliminating the need for host cron configuration.
New features:
- backup-cron service: Alpine-based container with Docker CLI and cron
- Automated daily backup at 5:00 AM (Europe/Paris timezone)
- Automated health check at 6:00 AM (after backup)
- Weekly log cleanup on Sundays at 3:00 AM (removes logs >30 days)
Files added:
- cron/Dockerfile: Alpine Linux with docker-cli, bash, and tzdata
- cron/entrypoint.sh: Starts crond and displays configuration
- cron/crontab: Scheduled tasks configuration
- cron/README.md: Complete documentation for automated backups
- scripts/clean-old-logs.sh: Automated log cleanup script
Makefile enhancements:
- make cron-status: Display backup automation status and schedule
- make cron-logs: View logs from automated tasks
Configuration improvements:
- Auto-detect COMPOSE_PROJECT_NAME from directory name (portable)
- Fix df command to use POSIX format (-P flag) for consistent output
- Updated .env.example with COMPOSE_PROJECT_NAME documentation
Benefits:
- No host cron configuration required
- Portable across different environments
- Automatic timezone handling
- Integrated with existing backup/health check scripts
- Logs all automated tasks for monitoring
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Security (CRITICAL):
- Add .env.example with strong password generation instructions
- Fix path traversal validation in restore.sh (now detects all .. patterns)
- Secure .env loading with set -a/set +a in all scripts
- Add logs/ to .gitignore to prevent credential leaks
Backup & Restore (IMPORTANT):
- Add file locking system to prevent concurrent backups
- Add disk space verification before backup operations
- Generate SHA256 checksums for all backups
- Verify checksums before restoration
- Create safety database backup before restore
- Implement comprehensive logging to ./logs/ directory
- Fix BACKUP_RETENTION_DAYS inconsistency
- Replace dangerous find -delete with safe iteration
Update & Recovery:
- Backup docker-compose.yml before updates with auto-rollback
- Add version display before/after updates
- Increase timeouts to 120s for slow containers
- Dynamic backup suggestion in recover.sh
Compatibility:
- Add Docker Compose v2 support with v1 fallback in all scripts
- Standardized log() function across all scripts
New Features:
- Add check-health.sh: comprehensive system health monitoring
- Add SECURITY.md: complete security documentation
- Update Makefile with check-health and recover commands
- Centralized logging with timestamps and levels
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>