Shell scripts to incrementally sync Proxmox VE backups using rsync. Available for both Linux/macOS (bash) and Windows (PowerShell).
- SSH access to the Proxmox server (key-based authentication is recommended).
rsyncinstalled on your local machine:
- Linux/macOS: Usually pre-installed or available via package manager
- Windows: Install via one of the following:
- Git for Windows (includes rsync)
- WSL (Windows Subsystem for Linux)
- cwRsync or similar rsync port for Windows
git clone https://github.com/edoeel/rsync-backup-from-proxmox.git
cd rsync-backup-from-proxmoxEdit sync.sh and set the following variables:
# ⚙️ Configuration
PROXMOX_USER="root"
PROXMOX_HOST="192.168.1.2"
REMOTE_BACKUP_PATH="/var/lib/vz/dump"
LOCAL_BACKUP_PATH="/path/to/your/local/backups"Edit sync.ps1 and set the following variables:
# ⚙️ Configuration
$PROXMOX_USER = "root"
$PROXMOX_HOST = "192.168.1.2"
$REMOTE_BACKUP_PATH = "/var/lib/vz/dump"
$LOCAL_BACKUP_PATH = "$env:USERPROFILE\Documents\Proxmox"Configuration Variables:
PROXMOX_USER/$PROXMOX_USER: User for the Proxmox server (usuallyroot).PROXMOX_HOST/$PROXMOX_HOST: IP address or hostname of the Proxmox server.REMOTE_BACKUP_PATH/$REMOTE_BACKUP_PATH: Path to the backup directory on the Proxmox server.LOCAL_BACKUP_PATH/$LOCAL_BACKUP_PATH: Path to the destination directory on your local machine.
Note
The scripts automatically handle trailing slashes for REMOTE_BACKUP_PATH and LOCAL_BACKUP_PATH, so you don't need to worry about adding them.
chmod +x sync.shRun the bash script:
./sync.shRun the PowerShell script:
.\sync.ps1If you encounter execution policy restrictions on Windows, you may need to run:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserBoth scripts perform the same operations:
- Verify and create the local backup directory if it doesn't exist
- Use
rsyncwith the following options:-a: Archive mode (preserves permissions, ownership, timestamps, etc.)-v: Verbose (shows files being transferred)-z: Compress file data during transfer--progress: Shows file transfer progress
- Display appropriate success/error messages based on the exit code
The PowerShell version automatically detects and uses rsync from various sources (Git for Windows, WSL, etc.) and handles Windows path conversions.