From: Frank Brehm Date: Fri, 26 Nov 2021 08:50:51 +0000 (+0100) Subject: Renaming bin/zelos-make_backup_and_do_update.sh.sh -> bin/zelos-make_backup_and_do_up... X-Git-Tag: 0.4.1~5^2~26 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=b72050aac3b2260802ce664e54c9c65608143be4;p=pixelpark%2Fpp-admin-tools.git Renaming bin/zelos-make_backup_and_do_update.sh.sh -> bin/zelos-make_backup_and_do_update.sh --- diff --git a/bin/zelos-make_backup_and_do_update.sh b/bin/zelos-make_backup_and_do_update.sh new file mode 100755 index 0000000..8b4132e --- /dev/null +++ b/bin/zelos-make_backup_and_do_update.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +# by @rwaffen + +#update zelos +DATE=$(date '+%Y-%m-%d') +is_mounted=$(mount | grep /mnt/storagebox/backup -c) +backup_box_pass=$1 #see tpm + +if [ -z "${backup_box_pass}" ]; then + echo "Bitte Password aus TPM entnehmen!" + exit 1 +fi + +# mount hetzner backup disk +if [ $is_mounted -ne 1 ]; then + mount.cifs -o user=u234365,pass=${backup_box_pass} //u234365.your-storagebox.de/backup /mnt/storagebox/backup +fi + +# delete older backups +find /mnt/storagebox/backup -mtime +20 -delete + +# make file backups +echo "packe /root" +tar cfz /mnt/storagebox/backup/${DATE}_root.tgz /root + +echo "packe /opt/asterisk" +tar cfz /mnt/storagebox/backup/${DATE}_asterisk.tgz /opt/asterisk + +echo "packe /etc" +tar cfz /mnt/storagebox/backup/${DATE}_etc.tgz /etc + +echo "packe /home" +tar cfz /mnt/storagebox/backup/${DATE}_home.tgz /home + +# make db backup +echo "mache db dump" +echo "kann so 60min. dauern..." +time /root/MysqlDumps/backupZabbixDB.sh + +mv $(find /opt/dbstorage -name "*.bz2" -daystart -ctime 0) /mnt/storagebox/backup + +# update system +yum update -y + +# reboot +systemctl reboot diff --git a/bin/zelos-make_backup_and_do_update.sh.sh b/bin/zelos-make_backup_and_do_update.sh.sh deleted file mode 100644 index 8b4132e..0000000 --- a/bin/zelos-make_backup_and_do_update.sh.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -# by @rwaffen - -#update zelos -DATE=$(date '+%Y-%m-%d') -is_mounted=$(mount | grep /mnt/storagebox/backup -c) -backup_box_pass=$1 #see tpm - -if [ -z "${backup_box_pass}" ]; then - echo "Bitte Password aus TPM entnehmen!" - exit 1 -fi - -# mount hetzner backup disk -if [ $is_mounted -ne 1 ]; then - mount.cifs -o user=u234365,pass=${backup_box_pass} //u234365.your-storagebox.de/backup /mnt/storagebox/backup -fi - -# delete older backups -find /mnt/storagebox/backup -mtime +20 -delete - -# make file backups -echo "packe /root" -tar cfz /mnt/storagebox/backup/${DATE}_root.tgz /root - -echo "packe /opt/asterisk" -tar cfz /mnt/storagebox/backup/${DATE}_asterisk.tgz /opt/asterisk - -echo "packe /etc" -tar cfz /mnt/storagebox/backup/${DATE}_etc.tgz /etc - -echo "packe /home" -tar cfz /mnt/storagebox/backup/${DATE}_home.tgz /home - -# make db backup -echo "mache db dump" -echo "kann so 60min. dauern..." -time /root/MysqlDumps/backupZabbixDB.sh - -mv $(find /opt/dbstorage -name "*.bz2" -daystart -ctime 0) /mnt/storagebox/backup - -# update system -yum update -y - -# reboot -systemctl reboot