aboutsummaryrefslogtreecommitdiff
path: root/bin/Backup
diff options
context:
space:
mode:
authorJakob Stendahl <jakobste@uio.no>2021-01-15 17:11:44 +0100
committerJakob Stendahl <jakobste@uio.no>2021-01-15 17:11:44 +0100
commit7821641032d81b369de3dbfe4e9f6815ba75eacc (patch)
tree7a7536f5aab802eca54cd311049aa481edb7a9bf /bin/Backup
parent2916ae8bc25797c4516e832851f5f9f28f1aa10c (diff)
downloaddotfiles-7821641032d81b369de3dbfe4e9f6815ba75eacc.tar.gz
dotfiles-7821641032d81b369de3dbfe4e9f6815ba75eacc.zip
Sóme changes
Diffstat (limited to 'bin/Backup')
-rwxr-xr-xbin/Backup13
1 files changed, 7 insertions, 6 deletions
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