The **MB Backup Manager** is a comprehensive backup solution designed for managing automated backups of web applications, particularly those running on the Virtuozzo Application Platform. This tool leverages cron jobs for scheduling backups and utilizes Restic for efficient backup storage and management.
## Features
- **Automated Backups**: Schedule daily, weekly, or custom backups using cron jobs.
- **Backup Types**: Supports backing up core files, media files, and databases.
- **Logging**: Detailed logging of backup operations for monitoring and troubleshooting.
- **Backup Rotation**: Automatically manages old backups to save storage space.
## Installation
1.**Clone the Repository**:
Clone the repository containing the backup manager scripts to your local machine or server. The repository can be found at:
Ensure that `Restic` and `cron` are installed on your system. You can install them using the following commands:
```bash
sudo dnf install -y cronie
sudo dnf install -y restic
```
3.**Set Up Directory Structure**:
Create the necessary directories for logs and scripts:
```bash
mkdir -p /home/litespeed/mb-backups/logs/auto
mkdir -p /home/litespeed/mb-backups/logs/manual
```
4.**Configure Environment**:
Ensure that the environment variables and configuration files are set up correctly, including the Restic password stored in `/etc/restic-password`.
5.**Install from the Virtuozzo Marketplace**:
To install the MB Backup Manager from the Virtuozzo Marketplace, follow these steps:
- Log in to your Virtuozzo Application Platform dashboard.
- Navigate to the **Marketplace** section.
- Search for "MB Backup Manager" in the marketplace.
- Click on the application to view its details and click the **Install** button.
- Follow the prompts to complete the installation process.
For more detailed instructions on using the Virtuozzo Marketplace, refer to the official documentation: [Virtuozzo Marketplace Documentation](https://www.virtuozzo.com/application-platform-docs/marketplace/).
## Usage
### Managing Backup Schedules
The `manage_backup_schedule.sh` script is used to add, update, or remove backup schedules.
- **Add or Update a Backup Schedule**:
To add or update a backup schedule, run the following command:
- If you encounter issues with Restic, check the Restic logs for detailed error messages. You can enable verbose logging by adding the `-v` flag to your Restic commands.
- If the scheduled cron job is not found, ensure that the `manage_backup_schedule.sh` script was executed successfully and that the cron job was added correctly.
- If the job is missing, re-run the `manage_backup_schedule.sh` script with the correct parameters.
6.**Debugging Cron Jobs**:
- If your cron job is not executing as expected, you can redirect the output and error messages to a log file by modifying the cron command in the `manage_backup_schedule.sh` script. For example:
- This will help capture any errors that occur when the cron job runs.
7.**Environment Variables**:
- Ensure that any environment variables required by your scripts (like `RESTIC_PASSWORD`) are set correctly. You can check the environment variables in your cron jobs by adding a command to print them to a log file:
- Ensure that the scripts have the correct permissions to execute. You can set the executable permission using:
```bash
chmod +x /home/litespeed/mb-backups/*.sh
```
9.**Testing Scripts Manually**:
- If you suspect an issue with a specific script, try running it manually in the terminal to see if it executes without errors. This can help isolate the problem.
10.**Check for Running Processes**:
- If you suspect that a backup process is already running, you can check for running instances of your backup scripts using:
```bash
pgrep -f backup_all.sh
```
- This will show you if there are any active processes related to your backup operations.
By following these debugging tips, you can effectively troubleshoot issues related to the MB Backup Manager and ensure that your backup processes run smoothly.
The MB Backup Manager provides a robust solution for managing backups in a cloud environment. By following the guidelines outlined in this documentation, developers can effectively set up, manage, and troubleshoot the backup processes. For further assistance, please refer to the log files or reach out to the development team.
## Repository Information
For the latest updates and commit history, you can find the repository at: