Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b0e336279b | |||
| f775f7ed4b | |||
| 22fc8bc6fc |
@@ -0,0 +1,34 @@
|
|||||||
|
#Edit all Variables for best Experience
|
||||||
|
|
||||||
|
SSHPORT='22' #SSH Port, usually default 22 internally
|
||||||
|
BACKUPSERVER=no #use yes for triggering Proxmox Backup to Store
|
||||||
|
ZSYNC=yes #skip Replication with no
|
||||||
|
MAINTDAY=7 #1 Monday to 7 Sunday, dont start your System too late
|
||||||
|
SHUTDOWN=no #No be there anymore
|
||||||
|
UPDATES=yes #Do PVE and PBS Updates after run
|
||||||
|
|
||||||
|
SOURCEHOST='192.168.50.200' # IP from Proxmox VE System to be backuped and replicated daily
|
||||||
|
|
||||||
|
#Replication
|
||||||
|
ZFSROOT='rpool/data' #First Dataset/Datastoresourcepath from Proxmox VE System to be backuped and replicated daily
|
||||||
|
ZFSSECOND='rpool-hdd/data' #Optional second Dataset
|
||||||
|
ZFSTRGT='rpool-ssd1/repl/pve200' #This pulling Machines Target ZFS Sourcepath
|
||||||
|
|
||||||
|
#Prevent Scrubs on Backups and Replications
|
||||||
|
ZPOOLSRC=rpool #First Pool/Tank from Proxmox VE System to be backuped and replicated daily
|
||||||
|
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
|
||||||
|
ZPUSHLABEL=zsync-rz #Suffix for ZFS-Auto-Snapshot Engine
|
||||||
|
ZPUSHFILTER="" #ZPUSHLABEL will be replicated. So you can add more Patterns from ZFS, line hourly, daily, weekly, monthly.
|
||||||
|
|
||||||
|
#Backup
|
||||||
|
PBSHOST='192.168.50.199' #IP from your Proxmox Backupserver - dont forget to add your hosts public key to PBS authorized keys
|
||||||
|
BACKUPSTORE=backup #Datastorename configured in your Proxmox VE System to be backuped and replicated daily
|
||||||
|
BACKUPSTOREPBS=backup #Datastorename configured in your Proxmox Backup Server
|
||||||
|
BACKUPEXCLUDE='124,3021,3022,3023,3251,3252,3253,3254' #Machines to be excluded from Proxmox Backup
|
||||||
|
REPLEXCLUDE=$BACKUPEXCLUDE
|
||||||
+18
-4
@@ -121,9 +121,22 @@ run_maintenance() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_scrub() {
|
run_scrub_stop_src() {
|
||||||
ssh root@"$SOURCEHOST" zpool scrub -s "$ZPOOLSRC"
|
ssh root@"$SOURCEHOST" 'for pool in $(zpool list -H -o name); do
|
||||||
zpool scrub -s "$ZPOOLDST"
|
echo "⏹️ Stoppe Scrub auf Pool: $pool"
|
||||||
|
zpool scrub -s "$pool"
|
||||||
|
done'
|
||||||
|
}
|
||||||
|
|
||||||
|
run_scrub_stop_local() {
|
||||||
|
for pool in $(zpool list -H -o name); do
|
||||||
|
echo "⏹️ Stoppe Scrub auf Pool: $pool"
|
||||||
|
if zpool scrub -s "$pool"; then
|
||||||
|
echo "✔️ Scrub auf $pool gestoppt"
|
||||||
|
else
|
||||||
|
echo "❌ Fehler beim Stoppen des Scrubs auf $pool"
|
||||||
|
fi
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
shutdown_if_requested() {
|
shutdown_if_requested() {
|
||||||
@@ -145,7 +158,8 @@ main() {
|
|||||||
run_zsync
|
run_zsync
|
||||||
run_updates
|
run_updates
|
||||||
run_maintenance
|
run_maintenance
|
||||||
run_scrub
|
run_scrub_stop_local
|
||||||
|
run_scrub_stop_src
|
||||||
run_pbs_backup
|
run_pbs_backup
|
||||||
run_remote_updates
|
run_remote_updates
|
||||||
shutdown_if_requested
|
shutdown_if_requested
|
||||||
|
|||||||
Reference in New Issue
Block a user