From 1648a1993fa2d83ac9602a38b48476f75069c3e9 Mon Sep 17 00:00:00 2001 From: Gocnak Date: Sat, 20 Oct 2018 06:45:08 -0400 Subject: [PATCH] More minor fixes Fixed rsync user and server being overwritten Added log file outputs for archive-rsync --- windows_archive/archive-rsync | 4 +++- windows_archive/setup-teslausb | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/windows_archive/archive-rsync b/windows_archive/archive-rsync index b076721..d163640 100644 --- a/windows_archive/archive-rsync +++ b/windows_archive/archive-rsync @@ -1,5 +1,7 @@ #!/bin/bash -eu +LOG_FILE=/tmp/archive-rsync.log + function log () { echo "$( date )" >> "$LOG_FILE" echo "$1" >> "$LOG_FILE" @@ -7,7 +9,7 @@ function log () { source /root/.teslaCamRsyncConfig -nfiles=$(rsync -auh --stats /mnt/cam/TeslaCam/saved* $user@$server:$path | awk '/files transferred/{print $NF}') +nfiles=$(rsync -auvh --stats --log-file=/tmp/archive-rsync-cmd.log /mnt/cam/TeslaCam/saved* $user@$server:$path | awk '/files transferred/{print $NF}') if [ $nfiles > 0 ] then diff --git a/windows_archive/setup-teslausb b/windows_archive/setup-teslausb index 4fa2540..829f631 100644 --- a/windows_archive/setup-teslausb +++ b/windows_archive/setup-teslausb @@ -112,8 +112,8 @@ function configure_archive () { then echo "Configuring for Rsync..." echo "user=$RSYNC_USER" > /root/.teslaCamRsyncConfig - echo "server=$RSYNC_SERVER" > /root/.teslaCamRsyncConfig - echo "path=$RSYNC_PATH" > /root/.teslaCamRsyncConfig + echo "server=$RSYNC_SERVER" >> /root/.teslaCamRsyncConfig + echo "path=$RSYNC_PATH" >> /root/.teslaCamRsyncConfig else echo "Configuring for a shared drive..." mkdir /mnt/archive