diff --git a/rc_shared.sh b/rc_shared.sh index 31c5e17..78790fb 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -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 }