]> gitweb.hhaalo.de Git - simple-backup.git/commitdiff
change: restore with programm option logging
authorBastian Dehn <hhaalo@arcor.de>
Thu, 23 Aug 2018 16:36:46 +0000 (18:36 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Thu, 23 Aug 2018 17:30:48 +0000 (19:30 +0200)
restore

diff --git a/restore b/restore
index beb946d2b1ace3d77bf26aed089cd8fa6d64ec6c..548687d2479e74f2c97b694dbf772f161ba6a0c6 100755 (executable)
--- 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
 }