From 7821641032d81b369de3dbfe4e9f6815ba75eacc Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Fri, 15 Jan 2021 17:11:44 +0100 Subject: Sóme changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/Backup | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'bin/Backup') diff --git a/bin/Backup b/bin/Backup index a627fd9..9fe9623 100755 --- a/bin/Backup +++ b/bin/Backup @@ -1,5 +1,5 @@ #!/bin/bash -destination="jmbp@192.168.32.102::jmbp" +destination="jmbp@openmediavault.dmz::jmbp" backupPaths=("Desktop" "Movies" "Music" "Documents" "Pictures" "_code" "Google Drive") spinner() { @@ -28,7 +28,9 @@ clearLines() { tput civis mtmpdir=$(mktemp -d) -printf "Directory for log files: '$mtmpdir'.\n" +mtempfile=$(mktemp) +#printf "Directory for log files: '$mtmpdir'.\n" +printf "\nLogfile: '$mtempfile'.\n" # Run rsync on all the directories error=false @@ -36,12 +38,11 @@ for path in "${backupPaths[@]}"; do # Just print the status-text tput setaf 4 printf "\n%-22s" "$main$path..." - tput sc; tput setaf 8 - printf "\n(tail -f \"$mtmpdir/$path.log\")" - tput sgr0; tput rc; tput el + tput sgr0 + printf "\n\n*********************\nSyncing directory '$path'.\n*********************\n" >> "$mtempfile" # Actually start rsync for the directory - rsync -az --info=all --log-file="$mtmpdir/$path.log" "$path" "$destination" &> /dev/null & + rsync -az --info=all --log-file="$mtempfile" "$path" "$destination" &> /dev/null & rsyncPID=$! trap "kill $rsyncPID 2> /dev/null" EXIT spinner $rsyncPID -- cgit v1.2.3