Update emulator-sync-scripts.sh
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
VERS='1.1.1-08122023'
|
VERS='1.1.6-08292023'
|
||||||
|
|
||||||
source /opt/idssys/defaults/colors.inc
|
source /opt/idssys/defaults/colors.inc
|
||||||
source /opt/idssys/defaults/default.inc
|
source /opt/idssys/defaults/default.inc
|
||||||
@@ -35,11 +35,11 @@ RUNSYNC(){
|
|||||||
|
|
||||||
[ -f ${ES_FOLDER}/mount.failure ] && /bin/rm -f ${ES_FOLDER}/mount.failure
|
[ -f ${ES_FOLDER}/mount.failure ] && /bin/rm -f ${ES_FOLDER}/mount.failure
|
||||||
if [ -f ${ES_LOGFOLDER}/failures.txt ]; then
|
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
|
if [ -f ${ES_LOGFOLDER}/failures2.txt ]; then
|
||||||
echo "Nextcloud sync failure, ${ES_LOGFOLDER}/failures.txt exists."
|
echo "Nextcloud sync failure, ${ES_LOGFOLDER}/failures2.txt exists."
|
||||||
SENDNOTICE "Nextcloud Sync Failure" "${ES_LOGFOLDER}/failures.txt Exists\n\n$(date)" 1
|
SENDNOTICE "Nextcloud Sync Failure" "${ES_LOGFOLDER}/failures2.txt Exists\n\n$(date)" 1
|
||||||
/bin/rm -f ${ES_FOLDER}/nc-sync.running
|
/bin/rm -f ${ES_FOLDER}/nc-sync.running
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
@@ -48,14 +48,16 @@ RUNSYNC(){
|
|||||||
fi
|
fi
|
||||||
if [ ! -f ${ES_LOGFOLDER}/failures.txt ]; then
|
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
|
${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
|
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
|
echo "$(date): Fixed" >> ${NC_PATH}/sync.log
|
||||||
SENDNOTICE "Nextcloud Sync Fixed" "Sync is running again"
|
SENDNOTICE "Nextcloud Sync Fixed" "Sync is running again"
|
||||||
/bin/rm -f ${ES_LOGFOLDER}/failures*
|
/bin/rm -f ${ES_LOGFOLDER}/failures*
|
||||||
elif [ -f ${ES_LOGFOLDER}/failures2.txt ] && [ -f ${ES_LOGFOLDER}/failures.txt ]; then
|
elif [ -f ${ES_LOGFOLDER}/failures2.txt ] && [ -f ${ES_LOGFOLDER}/failures.txt ]; then
|
||||||
echo "Nextcloud 2nd sync failure"
|
echo -e "${idsCL[Red]}Nextcloud 2nd sync failure"
|
||||||
SENDNOTICE "Nextcloud 2nd Sync Failure" "${ES_LOGFOLDER}/failures2.txt Exists\n\n$(date)" 1
|
SENDNOTICE "Nextcloud 2nd Sync Failure" "${ES_LOGFOLDER}/failures2.txt Exists\n\n$(date)" 1
|
||||||
|
else
|
||||||
|
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
||||||
fi
|
fi
|
||||||
/bin/rm -f ${ES_FOLDER}/nc-sync.running
|
/bin/rm -f ${ES_FOLDER}/nc-sync.running
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user