Skip to content

About

A shell script to incrementally sync Proxmox VE backups using rsync.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Rsync backup from Proxmox

Shell scripts to incrementally sync Proxmox VE backups using rsync. Available for both Linux/macOS (bash) and Windows (PowerShell).

Prerequisites

  1. SSH access to the Proxmox server (key-based authentication is recommended).
  2. rsync installed 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

Setup

1. Clone the Repository

git clone https://github.com/edoeel/rsync-backup-from-proxmox.git
cd rsync-backup-from-proxmox

2. Configure the Script

For Linux/macOS (sync.sh)

Edit 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"

For Windows (sync.ps1)

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 (usually root).
  • 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.

3. Make the Script Executable (Linux/macOS only)

chmod +x sync.sh

Usage

Linux/macOS

Run the bash script:

./sync.sh

Windows

Run the PowerShell script:

.\sync.ps1

If you encounter execution policy restrictions on Windows, you may need to run:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

How It Works

Both scripts perform the same operations:

  1. Verify and create the local backup directory if it doesn't exist
  2. Use rsync with 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
  3. 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.

About

A shell script to incrementally sync Proxmox VE backups using rsync.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages