Files
teslausb/windows_archive/archive-rsync
Gocnak de3371f00c rsync will not be using the mnt/archive folder
It'll instead bypass and just call itself on its own
2018-10-20 05:30:57 -04:00

22 lines
557 B
Bash

#!/bin/bash -eu
function log () {
echo "$( date )" >> "$LOG_FILE"
echo "$1" >> "$LOG_FILE"
}
source /root/.teslaCamRsyncConfig
nfiles=$(rsync -auh --stats /mnt/cam/TeslaCam/saved* $user@$server:$path | awk '/files transferred/{print $NF}')
if [ $nfiles > 0 ]
then
if [ -r "/root/.teslaCamPushoverCredentials" ] && [ $nfiles > 0]
then
log "Sending Pushover message for copied files."
/root/bin/send-pushover $nfiles
fi
log "Successfully synced files through rsync!"
else
log "No files to archive through rsync!"
fi