Rebuilt targets

pull/184/head
deajan 4 years ago
parent eaeb218508
commit c2fef97c84

@ -7,7 +7,7 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance
AUTHOR="(C) 2013-2020 by Orsiris de Jong" AUTHOR="(C) 2013-2020 by Orsiris de Jong"
CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr"
PROGRAM_VERSION=1.3.0-prerc1 PROGRAM_VERSION=1.3.0-prerc1
PROGRAM_BUILD=2019122406 PROGRAM_BUILD=2020012301
IS_STABLE=false IS_STABLE=false
CONFIG_FILE_REVISION_REQUIRED=1.3.0 CONFIG_FILE_REVISION_REQUIRED=1.3.0
@ -2659,21 +2659,24 @@ function _CheckReplicasLocal {
return 1 return 1
fi fi
Logger "Checking minimum disk space in local replica [$replicaPath]." "NOTICE" if [ $MINIMUM_SPACE -ne 0 ]; then
diskSpace=$($DF_CMD "$replicaPath" | tail -1 | awk '{print $4}') Logger "Checking minimum disk space in local replica [$replicaPath]." "NOTICE"
retval=$? diskSpace=$($DF_CMD "$replicaPath" | tail -1 | awk '{print $4}')
if [ $retval -ne 0 ]; then retval=$?
Logger "Cannot get free space." "ERROR" $retval if [ $retval -ne 0 ]; then
else Logger "Cannot get free space." "ERROR" $retval
# Ugly fix for df in some busybox environments that can only show human formats else
if [ $(IsInteger $diskSpace) -eq 0 ]; then # Ugly fix for df in some busybox environments that can only show human formats
diskSpace=$(HumanToNumeric $diskSpace) if [ $(IsInteger $diskSpace) -eq 0 ]; then
fi diskSpace=$(HumanToNumeric $diskSpace)
fi
if [ $diskSpace -lt $MINIMUM_SPACE ]; then if [ $diskSpace -lt $MINIMUM_SPACE ]; then
Logger "There is not enough free space on local replica [$replicaPath] ($diskSpace KB)." "WARN" Logger "There is not enough free space on local replica [$replicaPath] ($diskSpace KB)." "WARN"
fi
fi fi
fi fi
return $retval
} }
function _CheckReplicasRemote { function _CheckReplicasRemote {
@ -2922,19 +2925,21 @@ function _CheckReplicasRemoteSub {
exit 1 exit 1
fi fi
RemoteLogger "Checking minimum disk space in remote replica [$replicaPath]." "NOTICE" if [ $MINIMUM_SPACE -ne 0 ]; then
diskSpace=$($DF_CMD "$replicaPath" | tail -1 | awk '{print $4}') RemoteLogger "Checking minimum disk space in remote replica [$replicaPath]." "NOTICE"
retval=$? diskSpace=$($DF_CMD "$replicaPath" | tail -1 | awk '{print $4}')
if [ $retval -ne 0 ]; then retval=$?
RemoteLogger "Cannot get free space." "ERROR" $retval if [ $retval -ne 0 ]; then
else RemoteLogger "Cannot get free space." "ERROR" $retval
# Ugly fix for df in some busybox environments that can only show human formats else
if [ $(IsInteger $diskSpace) -eq 0 ]; then # Ugly fix for df in some busybox environments that can only show human formats
diskSpace=$(HumanToNumeric $diskSpace) if [ $(IsInteger $diskSpace) -eq 0 ]; then
fi diskSpace=$(HumanToNumeric $diskSpace)
fi
if [ $diskSpace -lt $MINIMUM_SPACE ]; then if [ $diskSpace -lt $MINIMUM_SPACE ]; then
RemoteLogger "There is not enough free space on remote replica [$replicaPath] ($diskSpace KB)." "WARN" RemoteLogger "There is not enough free space on remote replica [$replicaPath] ($diskSpace KB)." "WARN"
fi
fi fi
fi fi
return $retval return $retval

@ -7,7 +7,7 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance
AUTHOR="(C) 2013-2020 by Orsiris de Jong" AUTHOR="(C) 2013-2020 by Orsiris de Jong"
CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr"
PROGRAM_VERSION=1.3.0-prerc1 PROGRAM_VERSION=1.3.0-prerc1
PROGRAM_BUILD=2019122406 PROGRAM_BUILD=2020012301
IS_STABLE=false IS_STABLE=false
CONFIG_FILE_REVISION_REQUIRED=1.3.0 CONFIG_FILE_REVISION_REQUIRED=1.3.0
@ -2506,21 +2506,24 @@ function _CheckReplicasLocal {
return 1 return 1
fi fi
Logger "Checking minimum disk space in local replica [$replicaPath]." "NOTICE" if [ $MINIMUM_SPACE -ne 0 ]; then
diskSpace=$($DF_CMD "$replicaPath" | tail -1 | awk '{print $4}') Logger "Checking minimum disk space in local replica [$replicaPath]." "NOTICE"
retval=$? diskSpace=$($DF_CMD "$replicaPath" | tail -1 | awk '{print $4}')
if [ $retval -ne 0 ]; then retval=$?
Logger "Cannot get free space." "ERROR" $retval if [ $retval -ne 0 ]; then
else Logger "Cannot get free space." "ERROR" $retval
# Ugly fix for df in some busybox environments that can only show human formats else
if [ $(IsInteger $diskSpace) -eq 0 ]; then # Ugly fix for df in some busybox environments that can only show human formats
diskSpace=$(HumanToNumeric $diskSpace) if [ $(IsInteger $diskSpace) -eq 0 ]; then
fi diskSpace=$(HumanToNumeric $diskSpace)
fi
if [ $diskSpace -lt $MINIMUM_SPACE ]; then if [ $diskSpace -lt $MINIMUM_SPACE ]; then
Logger "There is not enough free space on local replica [$replicaPath] ($diskSpace KB)." "WARN" Logger "There is not enough free space on local replica [$replicaPath] ($diskSpace KB)." "WARN"
fi
fi fi
fi fi
return $retval
} }
function _CheckReplicasRemote { function _CheckReplicasRemote {
@ -2759,19 +2762,21 @@ function _CheckReplicasRemoteSub {
exit 1 exit 1
fi fi
RemoteLogger "Checking minimum disk space in remote replica [$replicaPath]." "NOTICE" if [ $MINIMUM_SPACE -ne 0 ]; then
diskSpace=$($DF_CMD "$replicaPath" | tail -1 | awk '{print $4}') RemoteLogger "Checking minimum disk space in remote replica [$replicaPath]." "NOTICE"
retval=$? diskSpace=$($DF_CMD "$replicaPath" | tail -1 | awk '{print $4}')
if [ $retval -ne 0 ]; then retval=$?
RemoteLogger "Cannot get free space." "ERROR" $retval if [ $retval -ne 0 ]; then
else RemoteLogger "Cannot get free space." "ERROR" $retval
# Ugly fix for df in some busybox environments that can only show human formats else
if [ $(IsInteger $diskSpace) -eq 0 ]; then # Ugly fix for df in some busybox environments that can only show human formats
diskSpace=$(HumanToNumeric $diskSpace) if [ $(IsInteger $diskSpace) -eq 0 ]; then
fi diskSpace=$(HumanToNumeric $diskSpace)
fi
if [ $diskSpace -lt $MINIMUM_SPACE ]; then if [ $diskSpace -lt $MINIMUM_SPACE ]; then
RemoteLogger "There is not enough free space on remote replica [$replicaPath] ($diskSpace KB)." "WARN" RemoteLogger "There is not enough free space on remote replica [$replicaPath] ($diskSpace KB)." "WARN"
fi
fi fi
fi fi
return $retval return $retval

Loading…
Cancel
Save