Merge pull request #8 from bashclub/dev

Dev
This commit is contained in:
Chriz
2025-05-14 16:03:10 +02:00
committed by GitHub
2 changed files with 21 additions and 9 deletions

View File

@@ -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 ZPOOLDST=rpool #This pulling Machines Pool/Tank
#ZSYNC #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. 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 ZPUSHMINKEEP=3 #Keep min x Snapshots on all Source Datasets to resume Replication
ZPUSHKEEP=14 #Number of Snapshots with ZPUSHLABEL ZPUSHKEEP=14 #Number of Snapshots with ZPUSHLABEL

View File

@@ -24,7 +24,13 @@ echo "Configuring and runnging bashclub-zsyncs Config in /etc/bashclub/$SOURCEHO
SOURCEHOSTNAME=$(ssh $SOURCEHOST hostname) SOURCEHOSTNAME=$(ssh $SOURCEHOST hostname)
ssh root@$SOURCEHOST zfs set $ZPUSHTAG=all $ZFSROOT 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 ssh root@$SOURCEHOST zfs set $ZPUSHTAG=all rpool/pveconf #you have to use our postinstaller on source
echo "target=$ZFSTRGT" > /etc/bashclub/$SOURCEHOST.conf 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=1" >> /etc/bashclub/$SOURCEHOST.conf
echo "checkzfs_spool_maxage=90000" >> /etc/bashclub/$SOURCEHOST.conf echo "checkzfs_spool_maxage=90000" >> /etc/bashclub/$SOURCEHOST.conf
if [[ "$ZSYNC" == "no" ]]
then
echo "Bashclub-Zsync has been disabled in Config"
/usr/bin/bashclub-zsync -d -c /etc/bashclub/$SOURCEHOST.conf else
/usr/bin/bashclub-zsync -c /etc/bashclub/$SOURCEHOST.conf
fi
# Updating Miyagi Host to latest Proxmox VE (no major Version Upgrades!) # Updating Miyagi Host to latest Proxmox VE (no major Version Upgrades!)
@@ -74,14 +85,14 @@ fi
if [[ "$BACKUPSERVER" == "no" ]]; then if [[ "$BACKUPSERVER" == "no" ]]; then
echo No Backup configured in this Run echo No Backup configured in this Run && exit
[[ "$SHUTDOWN" == "yes" ]] && shutdown [[ "$SHUTDOWN" == "yes" ]] && shutdown now
fi fi
sleep 5
if [[ "$BACKUPSERVER" == "no" ]]; then if [[ "$BACKUPSERVER" == "yes" ]]; then
echo No Backup configured in this Run echo Backup configured in this Run, so here we go.
[[ "$SHUTDOWN" == "no" ]] && exit
fi fi
PRUNEJOB=$(ssh $PBSHOST proxmox-backup-manager prune-job list --output-format json-pretty | grep -m 1 "id" | cut -d'"' -f4) 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 ### 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 --pbs-change-detection-mode metadata --node $SOURCEHOSTNAME --storage $BACKUPSTORE --exclude $BACKUPEXCLUDE --mode snapshot --all 1 --notes-template '{{guestname}}'
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo command returned 0 is good echo command returned 0 is good