mirror of
https://github.com/cimryan/teslausb.git
synced 2026-03-01 04:30:33 +00:00
More minor fixes
Fixed rsync user and server being overwritten Added log file outputs for archive-rsync
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash -eu
|
#!/bin/bash -eu
|
||||||
|
|
||||||
|
LOG_FILE=/tmp/archive-rsync.log
|
||||||
|
|
||||||
function log () {
|
function log () {
|
||||||
echo "$( date )" >> "$LOG_FILE"
|
echo "$( date )" >> "$LOG_FILE"
|
||||||
echo "$1" >> "$LOG_FILE"
|
echo "$1" >> "$LOG_FILE"
|
||||||
@@ -7,7 +9,7 @@ function log () {
|
|||||||
|
|
||||||
source /root/.teslaCamRsyncConfig
|
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 ]
|
if [ $nfiles > 0 ]
|
||||||
then
|
then
|
||||||
|
|||||||
@@ -112,8 +112,8 @@ function configure_archive () {
|
|||||||
then
|
then
|
||||||
echo "Configuring for Rsync..."
|
echo "Configuring for Rsync..."
|
||||||
echo "user=$RSYNC_USER" > /root/.teslaCamRsyncConfig
|
echo "user=$RSYNC_USER" > /root/.teslaCamRsyncConfig
|
||||||
echo "server=$RSYNC_SERVER" > /root/.teslaCamRsyncConfig
|
echo "server=$RSYNC_SERVER" >> /root/.teslaCamRsyncConfig
|
||||||
echo "path=$RSYNC_PATH" > /root/.teslaCamRsyncConfig
|
echo "path=$RSYNC_PATH" >> /root/.teslaCamRsyncConfig
|
||||||
else
|
else
|
||||||
echo "Configuring for a shared drive..."
|
echo "Configuring for a shared drive..."
|
||||||
mkdir /mnt/archive
|
mkdir /mnt/archive
|
||||||
|
|||||||
Reference in New Issue
Block a user