diff --git a/emulator-sync-scripts.sh b/emulator-sync-scripts.sh index ae7772d..fa81bc3 100755 --- a/emulator-sync-scripts.sh +++ b/emulator-sync-scripts.sh @@ -1,6 +1,6 @@ #!/bin/bash -VERS='1.1.1-08122023' +VERS='1.1.6-08292023' source /opt/idssys/defaults/colors.inc source /opt/idssys/defaults/default.inc @@ -35,11 +35,11 @@ RUNSYNC(){ [ -f ${ES_FOLDER}/mount.failure ] && /bin/rm -f ${ES_FOLDER}/mount.failure if [ -f ${ES_LOGFOLDER}/failures.txt ]; then - echo -e "${idsCL[Red]}Failed${idsCL[Default]}" + # echo -e "${idsCL[Red]}Failed${idsCL[Default]}" if [ -f ${ES_LOGFOLDER}/failures2.txt ]; then - echo "Nextcloud sync failure, ${ES_LOGFOLDER}/failures.txt exists." - SENDNOTICE "Nextcloud Sync Failure" "${ES_LOGFOLDER}/failures.txt Exists\n\n$(date)" 1 + echo "Nextcloud sync failure, ${ES_LOGFOLDER}/failures2.txt exists." + SENDNOTICE "Nextcloud Sync Failure" "${ES_LOGFOLDER}/failures2.txt Exists\n\n$(date)" 1 /bin/rm -f ${ES_FOLDER}/nc-sync.running exit 1 else @@ -48,14 +48,16 @@ RUNSYNC(){ fi if [ ! -f ${ES_LOGFOLDER}/failures.txt ]; then ${ES_FOLDER}/nextcloud-sync-cron/nextcloud-sync-cron.sh --verbose --logdir ${ES_LOGFOLDER} ${ES_FOLDER}/nextcloud-client.conf - echo -e "${idsCL[Green]}Done${idsCL[Default]}" if [ -f ${ES_LOGFOLDER}/failures2.txt ] && [ ! -f ${ES_LOGFOLDER}/failures.txt ]; then + echo -e "${idsCL[Green]}Fixed, the last sync had failed${idsCL[Default]}" echo "$(date): Fixed" >> ${NC_PATH}/sync.log SENDNOTICE "Nextcloud Sync Fixed" "Sync is running again" /bin/rm -f ${ES_LOGFOLDER}/failures* elif [ -f ${ES_LOGFOLDER}/failures2.txt ] && [ -f ${ES_LOGFOLDER}/failures.txt ]; then - echo "Nextcloud 2nd sync failure" - SENDNOTICE "Nextcloud 2nd Sync Failure" "${ES_LOGFOLDER}/failures2.txt Exists\n\n$(date)" 1 + echo -e "${idsCL[Red]}Nextcloud 2nd sync failure" + SENDNOTICE "Nextcloud 2nd Sync Failure" "${ES_LOGFOLDER}/failures2.txt Exists\n\n$(date)" 1 + else + echo -e "${idsCL[Green]}Done${idsCL[Default]}" fi /bin/rm -f ${ES_FOLDER}/nc-sync.running fi