This commit is contained in:
2025-03-10 21:32:57 -05:00
parent 5acf9e6c78
commit 6307553ba8
3 changed files with 35 additions and 2 deletions

View File

@@ -909,12 +909,43 @@ REPLSTART(){
${PH_CMD} rm -f ${NM_FOLDER}/.test.${STATUS_START//-/}.repl
daterun=`date +%Y-%m-%d-%H-%M-%S`
${PH_CMD} "echo -e \"Replcation-Test\n${daterun}\" > ${NM_REPL_CHECK_LOC[${rcheck}]}/.test.${STATUS_START//-/}.repl" &
${PH_CMD} 'find ${NM_REPL_CHECK_LOC[${rcheck}]} -iname "*.sync-conflict-*" -exec rm {} \;' &
${PH_CMD} 'find '${NM_REPL_CHECK_LOC[${rcheck}]}' -iname "*.sync-conflict-*" -exec rm {} \;' &
done
fi
fi
}
REMOVE_CONFLICT_SYNC_FILES(){
echo
if [ "${1}" != "" ] && [ "${NM_NODETYPES[${1^^}]}" != "" ]; then
ntss=${1^^}
ntypesel=(${ntss})
else
ntss=""
ntypesel=(${NM_NODE_TYPES[@]})
fi
for NTYPE in "${ntypesel[@]}"; do
var=${NTYPE}_REPL_CHECK[@]
if [ ! -z ${!var+x} ]; then
var=${NTYPE}_HOSTS[@]
for nip in "${!var}"; do
if [ ! -f ${NM_TMPFOLDER}/${nip}.down ]; then
echo -e "${idsCL[LightYellow]}Removing all Syncthing 'sync-conflict' files from ${idsCL[LightGreen]}${NM_HOSTNAME[${nip}]}${idsCL[LightYellow]} [${nip}]${idsCL[Default]}"
PH_CMD="ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip}"
var2=${NTYPE}_REPL_CHECK[@]
for rcheck in "${!var2}"; do
echo -en "${idsCL[LightCyan]}Removing files from ${idsCL[Green]}${NM_REPL_CHECK_LOC[${rcheck}]}${idsCL[LightCyan]}${idsCL[Default]} ... "
${PH_CMD} 'find '${NM_REPL_CHECK_LOC[${rcheck}]}' -iname "*.sync-conflict-*" -exec rm {} \;' >/dev/null 2>&1
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
done
fi
echo
done
fi
done
echo
}
STATUS_SCANTIMES(){
start=$(date +%s)
scandefault=1440