From a9ba0747951ab17c5115ba9f52230a3c7824c861 Mon Sep 17 00:00:00 2001 From: gabi Date: Sat, 24 May 2025 00:35:02 +0200 Subject: [PATCH] readme --- README.md | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..9bcbc6d --- /dev/null +++ b/README.md @@ -0,0 +1,118 @@ +# Proxmox Backup Server to SMB Backup Script + +A robust and efficient backup solution for Proxmox Backup Server (PBS) that securely transfers backups to an SMB share. This script provides incremental backups, efficient space management, and detailed logging. + +## Features + +- ๐Ÿ”„ Incremental backups with file change detection +- ๐Ÿ“ฆ Chunked backup creation for large datasets +- ๐Ÿ’พ Efficient space management with configurable chunk sizes +- ๐Ÿ” Detailed logging and progress tracking +- ๐Ÿ”’ Secure SMB authentication +- ๐Ÿงน Automatic cleanup of old backups +- ๐Ÿ” Restore functionality +- ๐Ÿ“Š SQLite database for tracking file changes +- โšก Optimized performance with batch processing + +## Prerequisites + +- Linux-based system (tested on Proxmox Backup Server) +- Required packages: + - `sqlite3` + - `7zip` + - `rsync` + - `cifs-utils` + - `pv` (optional, for progress bars) + +## Installation + +1. Clone the repository: +```bash +git clone https://git.pandem.fr/gabriel/ProxmoxBackupsServer-to-SMB.git +cd ProxmoxBackupsServer-to-SMB +``` + +2. Make the script executable: +```bash +chmod +x backups2smb.sh +``` + +3. Configure the script by editing the configuration section at the top of `backups2smb.sh`: +```bash +# === Config === +SERVER_IP="192.168.2.194" # Your SMB server IP +SHARE_NAME="PBS-back" # SMB share name +MOUNT_POINT="/mnt/smb-backup" # Local mount point +CREDENTIALS_FILE="/root/.smb-pbs-cred" # SMB credentials file +CHUNK_SIZE="10G" # Size of backup chunks +MIN_SPACE_REQUIRED="5G" # Minimum required space in /tmp +``` + +4. Create the credentials file: +```bash +echo "username=your_username" > /root/.smb-pbs-cred +echo "password=your_password" >> /root/.smb-pbs-cred +chmod 600 /root/.smb-pbs-cred +``` + +## Usage + +### Regular Backup + +Run the script without any arguments to perform a regular backup: + +```bash +./backups2smb.sh +``` + +### Restore from Backup + +To restore from the latest backup: + +```bash +./backups2smb.sh -u +``` + +## Configuration Options + +The script can be customized by modifying the following variables in the configuration section: + +- `SERVER_IP`: IP address of your SMB server +- `SHARE_NAME`: Name of the SMB share +- `MOUNT_POINT`: Local mount point for the SMB share +- `CREDENTIALS_FILE`: Path to the SMB credentials file +- `CHUNK_SIZE`: Size of backup chunks (e.g., "10G") +- `MIN_SPACE_REQUIRED`: Minimum required space in /tmp +- `LOG`: Path to the log file +- `SRC`: Directories to backup (space-separated) + +## Logging + +The script maintains detailed logs at `/var/log/pbs-smb-backup.log`. Logs older than 7 days are automatically cleaned up. + +## Error Handling + +The script includes comprehensive error handling for: +- Network connectivity issues +- SMB mount failures +- Space constraints +- Process cleanup +- Database operations + +## Contributing + +Contributions are welcome! Please feel free to submit a Pull Request. + +## Contact + +For support or questions, please contact: +- Email: gabriel@pandem.fr + +## License + +This project is licensed under the MIT License - see the LICENSE file for details. + +## Acknowledgments + +- Thanks to the Proxmox team for their excellent backup server +- Inspired by various backup solutions in the Linux community \ No newline at end of file