From: Bastian Dehn Date: Wed, 18 Jul 2018 19:57:48 +0000 (+0200) Subject: remove: einfach backup with restore X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=25868cdcfceda043ea85823f3b50b946ad9cf325;p=simple-backup.git remove: einfach backup with restore --- diff --git a/backup-einfach b/backup-einfach deleted file mode 100755 index 4fface7..0000000 --- a/backup-einfach +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash -### Script macht ein Backup von verschiedenen Pfaden -### auf verschiedenen Rechner und Syncronisiert das Backup - -# Informationen fuer den Sicherungsserver -SetDefaultVariables() -{ - backpath="/images/backup" - backDir="einfach-sicherung" -} - -CreateBackupFolderRemotePC() -{ - mkdir --parents $backpath/$backDir/$remoterechner -} - -printfStripLine() -{ - printf "####################" - printf "####################" - printf "####################" - printf "####################\n" -} - -BackupPathes() -{ - local logFile="" - - for pfad in $(cat pfad-$remoterechner.txt); do - printfStripLine - printf "\nRechner %s; Pfad %s" "$remoterechner" "$pfad" - printf " wird gesichert\n\n" - - logFile="$backRemotePCPath/backup-$(echo $pfad \ - | sed 's/\//-/g').log" - savelog -nJ9 -c 20 $logFile - - rsync --archive --verbose --sparse --acls --hard-links \ - --relative --human-readable --delete \ - --log-file=$logFile \ - $remoteLogin:$pfad \ - $backRemotePCPath - printfStripLine - done -} - -BackupRemotePC() -{ - remoteuser="root" - - for remoterechner in $(cat rechner.txt); do - CreateBackupFolderRemotePC - - backRemotePCPath="$backpath/$backDir/$remoterechner" - remoteLogin="$remoteuser@$remoterechner" - - BackupPathes - done -} - -main() -{ - SetDefaultVariables - BackupRemotePC -} - -main $* - -exit 0 diff --git a/restore-einfach b/restore-einfach deleted file mode 100755 index 8fb73ea..0000000 --- a/restore-einfach +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -SetDefaultVariables() -{ - backpath="/images/backup" - backDir="einfach-sicherung" -} - -ReadArguments() -{ - while getopts "r:p:" optname; do - case "$optname" in - "r") - rechner="$OPTARG" - ;; - "p") - pfad="$OPTARG" - ;; - esac - done - - if [ -z "$rechner" ] || [ -z "$pfad" ]; then - printf "Es fehlen Parameter!\n" - exit 1 - fi -} - -printfStripLine() -{ - printf "####################" - printf "####################" - printf "####################" - printf "####################\n" -} - -RestoreData() -{ - remoteLogin="root@$rechner" - fullPathBackPath="$backpath/$backDir" - - printfStripLine - printf "Daten werden wiederhergestellt\n\n" - printf "Pfad: %s\n" $pfad - printf "Rechner: %s\n" $rechner - printfStripLine - - savelog -nJ9 $backpath/restore-*.log - - rsync --archive --verbose --sparse --acls --hard-links \ - --human-readable \ - --log-file $backpath/restore-einfach-$(date +%Y-%m-%d).log \ - $fullPathBackPath/$rechner/$pfad \ - $remoteLogin:$pfad -} - -main() -{ - SetDefaultVariables - ReadArguments $* - RestoreData -} - -main $* - -exit 0