- Improved restoration script to handle specific backup types (core files, media files, database backups) based on tags.
- Integrated functionality to restore databases directly by piping `.sql` files from Restic to MySQL.
- Added automatic detection of database credentials from `wp-config.php` with fallback to default values for `DB_HOST`.
- Ensured proper environment setup with `RESTIC_PASSWORD` retrieved securely from `/etc/restic-password`.
- **Automatic Backup Tagging**:
- Modified `backup_all.sh` to differentiate between manual (`manual-backup-YYYY-MM-DD_HH-MM-SS`) and automated (`auto-backup-YYYY-MM-DD_HH-MM-SS`) backups.
- Ensured backups triggered by cron jobs are tagged appropriately for easy identification.
- **`manage_backup_schedule.sh` Enhancements**:
- Ensured `backup_all.sh` runs in `auto` mode when added to cron, guaranteeing automated backups have the correct tags.
- Validated cron job syntax and dependencies to avoid misconfigurations.
- Added explicit logging of cron actions, including schedule additions, updates, removals, and listing.
- **Improved Error Messaging**:
- Enhanced restoration script to provide detailed error messages when database restoration fails, including incorrect credentials or insufficient privileges.
### Fixed
- Resolved issues with incorrect handling of database restoration paths, ensuring `.sql` files are restored directly into MySQL when detected.
- Addressed potential confusion in tagging by clearly segregating manual and automated backups in logs and tags.
- Corrected empty `DB_HOST` values in the restoration script by setting a default to `localhost` when no value is provided in `wp-config.php`.
### Updated
- **Logging and Traceability**:
- Enhanced all relevant scripts (`restore_backup_direct.sh`, `backup_all.sh`, `manage_backup_schedule.sh`) to log detailed timestamps and descriptive messages.
- Improved consistency in log formatting across scripts for better traceability.
- Added detailed logs for all cron operations in `manage_backup_schedule.sh` to track automated backups effectively.
### Improved
- **Backup and Restore Modularity**:
- Streamlined the orchestration of backups and restores to ensure modularity and easier debugging.
- Improved robustness of `restore_backup_direct.sh` by handling different backup types dynamically using snapshot tags.
- Simplified management of cron schedules with better error handling and validation in `manage_backup_schedule.sh`.
- **Error Handling**:
- Ensured all scripts exit gracefully on errors with detailed logs to pinpoint issues.
- Enhanced dependency validation to check for all required tools (`restic`, `mysql`, `jq`, `crontab`, etc.) before execution.
- **Code Maintenance**:
- Centralized key operations such as password retrieval, lock handling, and backup tagging across scripts for easier maintenance and fewer redundancies.