mirror of
https://github.com/bashclub/miyagi-pbs-zfs.git
synced 2025-12-06 09:28:44 +00:00
@@ -4,6 +4,7 @@ SSHPORT='22' #SSH Port, usually default 22 internally
|
|||||||
BACKUPSERVER=no #use yes for triggering Proxmox Backup to Store
|
BACKUPSERVER=no #use yes for triggering Proxmox Backup to Store
|
||||||
MAINTDAY=7 #1 Monday to 7 Sunday, dont start your System too late
|
MAINTDAY=7 #1 Monday to 7 Sunday, dont start your System too late
|
||||||
SHUTDOWN=no #No be there anymore
|
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
|
SOURCEHOST='192.168.50.200' # IP from Proxmox VE System to be backuped and replicated daily
|
||||||
SOURCEHOSTNAME='pve3' #Hostname of Proxmox VE System to be backuped and replicated daily
|
SOURCEHOSTNAME='pve3' #Hostname of Proxmox VE System to be backuped and replicated daily
|
||||||
|
|||||||
18
dynroute.sh
Normal file
18
dynroute.sh
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# DDNS Name und Gateway
|
||||||
|
# usage dynroute.sh ddnsname yourgatewayrouter
|
||||||
|
# assuming a shutdown after usage, old routes will "not" be deleted
|
||||||
|
DDNS_HOSTNAME=$1
|
||||||
|
GATEWAY=$2
|
||||||
|
|
||||||
|
#DNS via One
|
||||||
|
ip route add 1.1.1.1 via 192.168.66.1
|
||||||
|
echo "nameserver 1.1.1.1" > /etc/resolv.conf
|
||||||
|
|
||||||
|
# ddns auflösen
|
||||||
|
CURRENT_IP=$(dig +short $DDNS_HOSTNAME)
|
||||||
|
if [[ -z "$CURRENT_IP" ]]; then
|
||||||
|
echo "Failed to resolve IP for $DDNS_HOSTNAME"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# route setzen
|
||||||
|
ip route add $CURRENT_IP via $GATEWAY
|
||||||
@@ -28,8 +28,10 @@ echo "zfs_auto_snapshot_label=$ZPUSHLABEL" >> /etc/bashclub/$SOURCEHOST.conf
|
|||||||
|
|
||||||
/usr/bin/bashclub-zsync -d -c /etc/bashclub/$SOURCEHOST.conf
|
/usr/bin/bashclub-zsync -d -c /etc/bashclub/$SOURCEHOST.conf
|
||||||
|
|
||||||
|
CHECKZFS=$(which checkzfs)
|
||||||
|
|
||||||
# So one Day has 1440 Minutes, so we go condition Yellow on 1500
|
# So one Day has 1440 Minutes, so we go condition Yellow on 1500
|
||||||
/usr/local/bin/checkzfs --source $SOURCEHOST --replicafilter "$ZFSTRGT/" --filter "#$ZFSROOT/|#$ZFSSECOND/" --threshold 1500,2000 --output checkmk --prefix pull-$(hostname):$ZPUSHTAG> /tmp/cmk_tmp.out && ( echo "<<<local>>>" ; cat /tmp/cmk_tmp.out ) > /tmp/90000_checkzfs
|
$CHECKZFS --source $SOURCEHOST --replicafilter "$ZFSTRGT/" --filter "#$ZFSROOT/|#$ZFSSECOND/" --threshold 1500,2000 --output checkmk --prefix pull-$(hostname):$ZPUSHTAG> /tmp/cmk_tmp.out && ( echo "<<<local>>>" ; cat /tmp/cmk_tmp.out ) > /tmp/90000_checkzfs
|
||||||
|
|
||||||
scp /tmp/90000_checkzfs $SOURCEHOST:/var/lib/check_mk_agent/spool/90000_checkzfs_$(hostname)_$ZPOOLSRC
|
scp /tmp/90000_checkzfs $SOURCEHOST:/var/lib/check_mk_agent/spool/90000_checkzfs_$(hostname)_$ZPOOLSRC
|
||||||
|
|
||||||
@@ -84,8 +86,15 @@ scp /tmp/90000_checkpbs root@$SOURCEHOST:/var/lib/check_mk_agent/spool
|
|||||||
#doing updates without regeret
|
#doing updates without regeret
|
||||||
|
|
||||||
|
|
||||||
|
if [[ "$UPDATES" == "yes" ]]
|
||||||
|
then
|
||||||
apt dist-upgrade -y
|
apt dist-upgrade -y
|
||||||
ssh $PBSHOST apt dist-upgrade -y
|
ssh $PBSHOST apt dist-upgrade -y
|
||||||
|
else
|
||||||
|
echo no Updates configured - Consider updating more often!
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [[ "$SHUTDOWN" == "yes" ]]
|
if [[ "$SHUTDOWN" == "yes" ]]
|
||||||
then
|
then
|
||||||
|
|||||||
Reference in New Issue
Block a user