Make send-pushover safe to always invoke, and always invoke it. Split CIFS archiving to archive-cifs.sh

This commit is contained in:
cimryan
2018-10-23 20:26:27 -07:00
parent cb35f069bf
commit c563f287ba
5 changed files with 44 additions and 51 deletions

View File

@@ -1,14 +1,21 @@
#!/bin/bash -eu
local num_files_moved="$1"
function log () {
echo "$( date )" >> "$LOG_FILE"
echo "$1" >> "$LOG_FILE"
}
source /root/.teslaCamPushoverCredentials
if [ -r "/root/.teslaCamPushoverCredentials" ] && [ $num_files_moved > 0]
then
log "Sending Pushover message for moved files."
curl -F "token=$pushover_app_key" \
-F "user=$pushover_user_key" \
-F "title=Dashcam Copy Complete" \
-F "message=$1 file(s) were copied." \
https://api.pushover.net/1/messages
source /root/.teslaCamPushoverCredentials
curl -F "token=$pushover_app_key" \
-F "user=$pushover_user_key" \
-F "title=Dashcam Copy Complete" \
-F "message=$num_files_moved file(s) were copied." \
https://api.pushover.net/1/messages
fi