Fixed multiple log messages since lower sleep time

This commit is contained in:
deajan 2015-04-20 14:11:09 +02:00
parent 2f827f9246
commit 0ea1a3e5de
2 changed files with 14 additions and 3 deletions

View File

@ -31,6 +31,7 @@ UNDER WORK
RECENT CHANGES RECENT CHANGES
-------------- --------------
- Fixed multiple keep logging messages since sleep time between commands has been lowered under a second
- Added optional checksum parameter for the paranoid :) - Added optional checksum parameter for the paranoid :)
- Fixed typo in soft deletion code preventing logging slave deleted backup files - Fixed typo in soft deletion code preventing logging slave deleted backup files
- Removed legacy lockfile code from init script - Removed legacy lockfile code from init script

View File

@ -4,7 +4,7 @@ PROGRAM="Osync" # Rsync based two way sync engine with fault tolerance
AUTHOR="(L) 2013-2015 by Orsiris \"Ozy\" de Jong" AUTHOR="(L) 2013-2015 by Orsiris \"Ozy\" de Jong"
CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr"
PROGRAM_VERSION=1.00pre PROGRAM_VERSION=1.00pre
PROGRAM_BUILD=1304201501 PROGRAM_BUILD=2004201501
## type doesn't work on platforms other than linux (bash). If if doesn't work, always assume output is not a zero exitcode ## type doesn't work on platforms other than linux (bash). If if doesn't work, always assume output is not a zero exitcode
if ! type -p "$BASH" > /dev/null if ! type -p "$BASH" > /dev/null
@ -393,6 +393,7 @@ function GetRemoteOS
function WaitForTaskCompletion function WaitForTaskCompletion
{ {
soft_alert=0 soft_alert=0
log_ttime=0
SECONDS_BEGIN=$SECONDS SECONDS_BEGIN=$SECONDS
while eval "$PROCESS_TEST_CMD" > /dev/null while eval "$PROCESS_TEST_CMD" > /dev/null
do do
@ -400,7 +401,11 @@ function WaitForTaskCompletion
EXEC_TIME=$(($SECONDS - $SECONDS_BEGIN)) EXEC_TIME=$(($SECONDS - $SECONDS_BEGIN))
if [ $((($EXEC_TIME + 1) % $KEEP_LOGGING)) -eq 0 ] if [ $((($EXEC_TIME + 1) % $KEEP_LOGGING)) -eq 0 ]
then then
Log "Current task still running." if [ $log_ttime -ne $EXEC_TIME ]
then
log_ttime=$EXEC_TIME
Log "Current task still running."
fi
fi fi
if [ $EXEC_TIME -gt "$2" ] if [ $EXEC_TIME -gt "$2" ]
then then
@ -438,12 +443,17 @@ function WaitForTaskCompletion
function WaitForCompletion function WaitForCompletion
{ {
soft_alert=0 soft_alert=0
log_time=0
while eval "$PROCESS_TEST_CMD" > /dev/null while eval "$PROCESS_TEST_CMD" > /dev/null
do do
Spinner Spinner
if [ $((($SECONDS + 1) % $KEEP_LOGGING)) -eq 0 ] if [ $((($SECONDS + 1) % $KEEP_LOGGING)) -eq 0 ]
then then
Log "Current task still running." if [ $log_time -ne $EXEC_TIME ]
then
log_time=$EXEC_TIME
Log "Current task still running."
fi
fi fi
if [ $SECONDS -gt "$2" ] if [ $SECONDS -gt "$2" ]
then then