From 6811c14f0b303964e3337c64a57837a099f7487d Mon Sep 17 00:00:00 2001 From: Chriz Date: Wed, 16 Apr 2025 15:46:59 +0200 Subject: [PATCH 1/4] Update pbs-zfs-daily.sh Fixed Combination Shutdown/Backup --- pbs-zfs-daily.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pbs-zfs-daily.sh b/pbs-zfs-daily.sh index 53b0fbc..56203bd 100644 --- a/pbs-zfs-daily.sh +++ b/pbs-zfs-daily.sh @@ -45,7 +45,7 @@ echo "checkzfs_spool=1" >> /etc/bashclub/$SOURCEHOST.conf echo "checkzfs_spool_maxage=90000" >> /etc/bashclub/$SOURCEHOST.conf -/usr/bin/bashclub-zsync -d -c /etc/bashclub/$SOURCEHOST.conf +/usr/bin/bashclub-zsync -c /etc/bashclub/$SOURCEHOST.conf # Updating Miyagi Host to latest Proxmox VE (no major Version Upgrades!) @@ -74,14 +74,14 @@ fi if [[ "$BACKUPSERVER" == "no" ]]; then - echo No Backup configured in this Run - [[ "$SHUTDOWN" == "yes" ]] && shutdown + echo No Backup configured in this Run && exit + [[ "$SHUTDOWN" == "yes" ]] && shutdown now fi +sleep 5 -if [[ "$BACKUPSERVER" == "no" ]]; then +if [[ "$BACKUPSERVER" == "yes" ]]; then echo No Backup configured in this Run - [[ "$SHUTDOWN" == "no" ]] && exit fi PRUNEJOB=$(ssh $PBSHOST proxmox-backup-manager prune-job list --output-format json-pretty | grep -m 1 "id" | cut -d'"' -f4) From f51f0238062777bb06215b704de364b82fbd6a92 Mon Sep 17 00:00:00 2001 From: Chriz Date: Wed, 16 Apr 2025 16:35:55 +0200 Subject: [PATCH 2/4] Update pbs-zfs-daily.sh --pbs-change-detection-mode metadata for faster lxc backups --- pbs-zfs-daily.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pbs-zfs-daily.sh b/pbs-zfs-daily.sh index 56203bd..ef13015 100644 --- a/pbs-zfs-daily.sh +++ b/pbs-zfs-daily.sh @@ -106,7 +106,7 @@ fi ### one Day is 86400 Seconds, so we going Condition grey if no new Status File will be pushed -ssh root@$SOURCEHOST vzdump --node $SOURCEHOSTNAME --storage $BACKUPSTORE --exclude $BACKUPEXCLUDE --mode snapshot --all 1 --notes-template '{{guestname}}' +ssh root@$SOURCEHOST vzdump --node $SOURCEHOSTNAME --storage $BACKUPSTORE --exclude $BACKUPEXCLUDE --mode snapshot --all 1 --notes-template '{{guestname}}' --pbs-change-detection-mode metadata if [ $? -eq 0 ]; then echo command returned 0 is good From bee516bcb998e33ba9d90a57439548478db80818 Mon Sep 17 00:00:00 2001 From: Chriz Date: Wed, 16 Apr 2025 16:56:33 +0200 Subject: [PATCH 3/4] Update config.example Backup only with ZSYNC=no --- config.example | 1 + 1 file changed, 1 insertion(+) diff --git a/config.example b/config.example index eca102d..3a21453 100644 --- a/config.example +++ b/config.example @@ -18,6 +18,7 @@ ZPOOLSRC=rpool #First Pool/Tank from Proxmox VE System to be backuped and replic ZPOOLDST=rpool #This pulling Machines Pool/Tank #ZSYNC +ZSYNC=yes #set to no for Backup with PBS only ZPUSHTAG=bashclub:zsync-198-ssd #ZFS User parameter will be set on ZFSROOT and ZFSSECOND to select. ZPUSHMINKEEP=3 #Keep min x Snapshots on all Source Datasets to resume Replication ZPUSHKEEP=14 #Number of Snapshots with ZPUSHLABEL From 3222c78bd8162756f8cb7834a34eb3b70469a8d4 Mon Sep 17 00:00:00 2001 From: Chriz Date: Wed, 16 Apr 2025 16:58:20 +0200 Subject: [PATCH 4/4] Update pbs-zfs-daily.sh on empty Second ZFS, no Error output Minor Bugfixes --- pbs-zfs-daily.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/pbs-zfs-daily.sh b/pbs-zfs-daily.sh index ef13015..f65405c 100644 --- a/pbs-zfs-daily.sh +++ b/pbs-zfs-daily.sh @@ -24,7 +24,13 @@ echo "Configuring and runnging bashclub-zsyncs Config in /etc/bashclub/$SOURCEHO SOURCEHOSTNAME=$(ssh $SOURCEHOST hostname) ssh root@$SOURCEHOST zfs set $ZPUSHTAG=all $ZFSROOT -ssh root@$SOURCEHOST zfs set $ZPUSHTAG=all $ZFSSECOND +if [ -n "$ZFSSECOND" ]; then + ssh root@"$SOURCEHOST" "zfs set $ZPUSHTAG=all $ZFSSECOND" +else + echo "ZFSSECOND is not specified, not tagging on Source" +fi + + ssh root@$SOURCEHOST zfs set $ZPUSHTAG=all rpool/pveconf #you have to use our postinstaller on source echo "target=$ZFSTRGT" > /etc/bashclub/$SOURCEHOST.conf @@ -44,8 +50,13 @@ echo "checkzfs_max_snapshot_count=180,200" >> /etc/bashclub/$SOURCEHOST.conf echo "checkzfs_spool=1" >> /etc/bashclub/$SOURCEHOST.conf echo "checkzfs_spool_maxage=90000" >> /etc/bashclub/$SOURCEHOST.conf - -/usr/bin/bashclub-zsync -c /etc/bashclub/$SOURCEHOST.conf +if [[ "$ZSYNC" == "no" ]] + then + echo "Bashclub-Zsync has been disabled in Config" + + else + /usr/bin/bashclub-zsync -c /etc/bashclub/$SOURCEHOST.conf +fi # Updating Miyagi Host to latest Proxmox VE (no major Version Upgrades!) @@ -81,7 +92,7 @@ fi sleep 5 if [[ "$BACKUPSERVER" == "yes" ]]; then - echo No Backup configured in this Run + echo Backup configured in this Run, so here we go. fi PRUNEJOB=$(ssh $PBSHOST proxmox-backup-manager prune-job list --output-format json-pretty | grep -m 1 "id" | cut -d'"' -f4) @@ -106,7 +117,7 @@ fi ### one Day is 86400 Seconds, so we going Condition grey if no new Status File will be pushed -ssh root@$SOURCEHOST vzdump --node $SOURCEHOSTNAME --storage $BACKUPSTORE --exclude $BACKUPEXCLUDE --mode snapshot --all 1 --notes-template '{{guestname}}' --pbs-change-detection-mode metadata +ssh root@$SOURCEHOST vzdump --pbs-change-detection-mode metadata --node $SOURCEHOSTNAME --storage $BACKUPSTORE --exclude $BACKUPEXCLUDE --mode snapshot --all 1 --notes-template '{{guestname}}' if [ $? -eq 0 ]; then echo command returned 0 is good