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, ...