Proxmox folders to backup for easy restore/transfer

openaspace

Active Member
Sep 16, 2019
486
13
38
Italy
Proxmox folders to backup for easy restore/transfer? included network/firewall host etc..?

Code:
#!/bin/bash

# Variables
BACKUP_DIR="/backup/proxmox"  # Local backup directory
STORJ_BUCKET="storj_bucket"  # Your Storj bucket name
PROXMOX_DIRS="/etc/pve /var/lib/pve-cluster"  # Proxmox directories to backup
MAX_BACKUPS=5  # Maximum number of backups to keep

# Backup creation
DATE=$(date +%Y%m%d)
rsync -a $PROXMOX_DIRS $BACKUP_DIR/$DATE

# Versioning
cd $BACKUP_DIR
ls -t | sed -e "1,${MAX_BACKUPS}d" | xargs -d '\n' rm -rf

# Backup upload to Storj
rclone sync $BACKUP_DIR storj:$STORJ_BUCKET --delete-excluded --max-age ${MAX_BACKUPS}d

exit 0
 
Last edited:
No, stuff like networking and backups wouldn't be included, as they aren't in "/etc/pve" but /etc/network/interfaces, /etc/hosts, /etc/resolv.conf, /etc/vzdump.conf, ...
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!