From 9ae9d40f94c396235c937db7b9f85d399adfedeb Mon Sep 17 00:00:00 2001 From: ljm42 Date: Tue, 7 May 2024 08:39:46 -0700 Subject: [PATCH] fix: keep minor enhancements from #872 (#878) --- .../dynamix.unraid.net/etc/rc.d/rc.flash_backup | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/plugin/source/dynamix.unraid.net/etc/rc.d/rc.flash_backup b/plugin/source/dynamix.unraid.net/etc/rc.d/rc.flash_backup index 6093c5f51..9e1065ae9 100755 --- a/plugin/source/dynamix.unraid.net/etc/rc.d/rc.flash_backup +++ b/plugin/source/dynamix.unraid.net/etc/rc.d/rc.flash_backup @@ -79,9 +79,11 @@ flush() { # wait for existing git commands to finish before flushing _waitforgitlog "${FAST}" logger "flush: ${TASKACTION}" --tag flash_backup - # push any changes ad-hoc - # shellcheck disable=SC2086 - echo "${TASKACTION}_nolimit &>/dev/null" | at ${QUEUE} -M now &>/dev/null + # if _connected, push any changes ad-hoc + if _connected; then + # shellcheck disable=SC2086 + echo "${TASKACTION}_nolimit &>/dev/null" | at ${QUEUE} -M now &>/dev/null + fi } _watching() { local flash_backup_pid @@ -96,10 +98,13 @@ _watch() { _clearlocks # flush: this will ensure we start with a clean repo flush + # wait for flush to complete + sleep 3 + _waitforgitlog "${FAST}" logger "start watching for file changes" --tag flash_backup # start watcher loop while true; do - # wait for system to be connected to Unraid Connect Cloud, then process flash backups + # if system is connected to Unraid Connect Cloud, see if there are updates to process _connected && _f1 sleep 60 done