Add a counter to the sync loop, plus actually use the sleep timer variable.

This commit is contained in:
2026-05-28 15:12:23 -07:00
parent af9009f1e4
commit 35a64c49a3
+5 -3
View File
@@ -306,7 +306,7 @@ function sync-all {
echo -e "`date` - Done.\n"
}
function sync-all-loop {
typeset -i sleep_time
typeset -i sleep_time count
if [[ "$1" ]]; then
sleep_time="$1"
fi
@@ -314,10 +314,12 @@ function sync-all-loop {
sleep_time="300"
fi
log "`date` - Sleep timer set for '$sleep_time' seconds."
count=0
while true; do
sync-all
echo -e "\n\n*** Sleeping... ***\n\n"
sleep 300
count=$(( count + 1 ))
echo -e "\n\n*** Sleeping for '$sleep_time' after run# '$count'! ***\n\n"
sleep $sleep_time
done
}