From da865dc1aaf32745fcae16a4aa59cb90cb52c8ba Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Thu, 23 Aug 2018 18:36:46 +0200 Subject: [PATCH] change: restore with programm option logging --- restore | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/restore b/restore index beb946d..548687d 100755 --- a/restore +++ b/restore @@ -45,20 +45,31 @@ RestoreData() remoteLogin="root@$rechner" backDir="$datum"_"$number"_"$backname" fullPathBackPath="$backpath/$backDir" + local restoreLog="$backpath/restore-$(date +%Y-%m-%d).log" + + savelog -nJ9 $backpath/restore-*.log printfStripLine - printf "Daten werden wiederhergestellt\n\n" - printf "Pfad: %s\n" $pfad - printf "Rechner: %s\n\n" $rechner - printf "von der Sicherung vom %s\n" $datum + printf "Daten werden wiederhergestellt\n\n" \ + | tee $restoreLog + printf "vom Datum: %s\n" "$datum" \ + | tee -a $restoreLog + printf "Nummer: %s\n" "$number" \ + | tee -a $restoreLog + printf "Rechner: %s\n" "$rechner" \ + | tee -a $restoreLog + printf "Pfad: %s\n\n" "$pfad" \ + | tee -a $restoreLog + printf "rsync --archive --verbose --sparse --acls --hard-links \ +--human-readable --log-file %s/%s %s/%s/%s %s:%s\n\n" \ + "$backpath" "$restoreLog" "$fullPathBackPath" "$rechner" \ + "$pfad" "$remoteLogin" "$pfad" | tee -a $restoreLog printfStripLine - savelog -nJ9 $backpath/restore-*.log rsync --archive --verbose --sparse --acls --hard-links \ --human-readable \ - --log-file $backpath/restore-$(date +%Y-%m-%d).log \ - $fullPathBackPath/$rechner/$pfad \ + --log-file $restoreLog $fullPathBackPath/$rechner/$pfad \ $remoteLogin:$pfad } -- 2.39.5