mirror of
https://github.com/cimryan/teslausb.git
synced 2026-03-01 04:30:33 +00:00
22 lines
557 B
Bash
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 |