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"
|
echo -e "`date` - Done.\n"
|
||||||
}
|
}
|
||||||
function sync-all-loop {
|
function sync-all-loop {
|
||||||
typeset -i sleep_time
|
typeset -i sleep_time count
|
||||||
if [[ "$1" ]]; then
|
if [[ "$1" ]]; then
|
||||||
sleep_time="$1"
|
sleep_time="$1"
|
||||||
fi
|
fi
|
||||||
@@ -314,10 +314,12 @@ function sync-all-loop {
|
|||||||
sleep_time="300"
|
sleep_time="300"
|
||||||
fi
|
fi
|
||||||
log "`date` - Sleep timer set for '$sleep_time' seconds."
|
log "`date` - Sleep timer set for '$sleep_time' seconds."
|
||||||
|
count=0
|
||||||
while true; do
|
while true; do
|
||||||
sync-all
|
sync-all
|
||||||
echo -e "\n\n*** Sleeping... ***\n\n"
|
count=$(( count + 1 ))
|
||||||
sleep 300
|
echo -e "\n\n*** Sleeping for '$sleep_time' after run# '$count'! ***\n\n"
|
||||||
|
sleep $sleep_time
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user