PVE settings backup

listhor

Member
Nov 14, 2023
39
1
13
So far, I periodically copy (using below script) content of PVE host's /etc selected folders to nfs folder.

Code:
#!/bin/sh
BACKUP_PATH="/mnt/pve/mmds-nfs/host_config/"
BACKUP_FILE="pvess"
KEEP_DAYS=7
PVE_BACKUP_SET="/etc/pve/ /etc/lvm/ /etc/modprobe.d/ /etc/network/interfaces /etc/vzdump.conf /etc/sysctl.d /etc/resolv.conf /etc/ksmtuned.conf /etc/hosts /etc/hostname /etc/cron* /etc/aliases"
PVE_CUSTOM_BACKUP_SET="/etc/systemd/network"

tar -czf $BACKUP_PATH$BACKUP_FILE-$(date +%Y_%m_%d-%H_%M_%S).tar.gz --absolute-names $PVE_BACKUP_SET $PVE_CUSTOM_BACKUP_SET
find $BACKUP_PATH$BACKUP_FILE-* -mindepth 0 -maxdepth 0 -depth -mtime +$KEEP_DAYS -delete

Is there any plan to introduce something more official, either via cli or webgui to make sure all settings are copied and later easily restored when needed? Or maybe I don't know more proper approach?
 
just curious, why you need to back up those setting periodically?

normally those are just default, or even a onetime setting and forgot it thing right? isn't one time backup after modification should be more than good enough?
 
just curious, why you need to back up those setting periodically?

normally those are just default, or even a onetime setting and forgot it thing right? isn't one time backup after modification should be more than good enough?
Periodically is mainly for content of /etc/pve folder (change of VMs or lxc) plus script takes care about keeping last 7 daily backups...
 
I use PBS for VMs and lxc but in case of restoring PVE host itself I would like to have a copy of for example, storage and resource mappings...