generated from me/template-mit
Add a counter to the sync loop, plus actually use the sleep timer variable.
This commit is contained in:
+5
-3
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user