Rebuilt targets
This commit is contained in:
parent
3accf5f254
commit
02d0024df9
|
@ -7,7 +7,7 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance
|
|||
AUTHOR="(C) 2013-2019 by Orsiris de Jong"
|
||||
CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr"
|
||||
PROGRAM_VERSION=1.3.0-pre-rc1
|
||||
PROGRAM_BUILD=2019052010
|
||||
PROGRAM_BUILD=2019052011
|
||||
IS_STABLE=false
|
||||
|
||||
CONFIG_FILE_REVISION_REQUIRED=1.3.0
|
||||
|
@ -5769,25 +5769,29 @@ function _SummaryFromRsyncFile {
|
|||
|
||||
if [ -f "$summaryFile" ]; then
|
||||
while read -r file; do
|
||||
# grep -E "^<|^>|^\." = Remove all lines that do not begin with '<', '>' or '.' to deal with a bizarre bug involving rsync 3.0.6 / CentOS 6 and --skip-compress showing 'adding zip' line for every skipped compressed extension
|
||||
if echo "$file" | grep -E "^<|^>|^\." > /dev/null 2>&1; then
|
||||
# grep -E "^<|^>|^\." = Remove all lines that do not begin with '<', '>' or '.' to deal with a bizarre bug involving rsync 3.0.6 / CentOS 6 and --skip-compress showing 'adding zip' l$
|
||||
if echo "$file" | grep -E "^<|^>|^\.|^\*" > /dev/null 2>&1; then
|
||||
# Check for time attribute changes only (eg rsync output '.d..t......'
|
||||
if echo "$file" | grep -E "\..\.\.t\.\.\.\.\.\." > /dev/null 2>&1; then
|
||||
verb="TIMESTAMP"
|
||||
elif echo "$file" | grep -E "\*deleting" > /dev/null 2>&1; then
|
||||
verb="DELETE"
|
||||
if [ "$direction" == ">>" ]; then
|
||||
TARGET_DELETES_COUNT=$((TARGET_DELETES_COUNT+1))
|
||||
elif [ "$direction" == "<<" ]; then
|
||||
INITIATOR_DELETES_COUNT=$((INITIATOR_DELETES_COUNT+1))
|
||||
fi
|
||||
else
|
||||
verb="UPDATE"
|
||||
if [ "$direction" == ">>" ]; then
|
||||
TARGET_UPDATES_COUNT=$((TARGET_UPDATES_COUNT+1))
|
||||
elif [ "$direction" == "<<" ]; then
|
||||
INITIATOR_UPDATES_COUNT=$((INITIATOR_UPDATES_COUNT+1))
|
||||
fi
|
||||
fi
|
||||
# awk removes first part of line until space, then show all others
|
||||
# We don't use awk '$1="";print $0' since it would keep a space as first character
|
||||
Logger "+ $direction $replicaPath$(echo "$file" | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}')" "ALWAYS"
|
||||
if [ "$direction" == ">>" ]; then
|
||||
TARGET_UPDATES_COUNT=$((TARGET_UPDATES_COUNT+1))
|
||||
elif [ "$direction" == "<<" ]; then
|
||||
INITIATOR_UPDATES_COUNT=$((INITIATOR_UPDATES_COUNT+1))
|
||||
fi
|
||||
fi
|
||||
if echo "$file" | grep -E "\*deleting" > /dev/null 2>&1; then
|
||||
if [ "$direction" == ">>" ]; then
|
||||
Logger "- $direction $replicaPath$(echo "$file" | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}')" "ALWAYS"
|
||||
TARGET_DELETES_COUNT=$((TARGET_DELETES_COUNT+1))
|
||||
elif [ "$direction" == "<<" ]; then
|
||||
Logger "- $direction $replicaPath$(echo "$file" | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}')" "ALWAYS"
|
||||
INITIATOR_DELETES_COUNT=$((INITIATOR_DELETES_COUNT+1))
|
||||
fi
|
||||
Logger "$verb $direction $replicaPath$(echo "$file" | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}')" "ALWAYS"
|
||||
fi
|
||||
done < "$summaryFile"
|
||||
fi
|
||||
|
@ -5802,7 +5806,7 @@ function _SummaryFromDeleteFile {
|
|||
|
||||
if [ -f "$summaryFile" ]; then
|
||||
while read -r file; do
|
||||
Logger "- $direction $replicaPath$file" "ALWAYS"
|
||||
Logger "DELETE $direction $replicaPath$file" "ALWAYS"
|
||||
if [ "$direction" == ">>" ]; then
|
||||
TARGET_DELETES_COUNT=$((TARGET_DELETES_COUNT+1))
|
||||
elif [ "$direction" == "<<" ]; then
|
||||
|
|
42
osync.sh
42
osync.sh
|
@ -7,7 +7,7 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance
|
|||
AUTHOR="(C) 2013-2019 by Orsiris de Jong"
|
||||
CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr"
|
||||
PROGRAM_VERSION=1.3.0-pre-rc1
|
||||
PROGRAM_BUILD=2019052010
|
||||
PROGRAM_BUILD=2019052011
|
||||
IS_STABLE=false
|
||||
|
||||
CONFIG_FILE_REVISION_REQUIRED=1.3.0
|
||||
|
@ -5534,25 +5534,29 @@ function _SummaryFromRsyncFile {
|
|||
|
||||
if [ -f "$summaryFile" ]; then
|
||||
while read -r file; do
|
||||
# grep -E "^<|^>|^\." = Remove all lines that do not begin with '<', '>' or '.' to deal with a bizarre bug involving rsync 3.0.6 / CentOS 6 and --skip-compress showing 'adding zip' line for every skipped compressed extension
|
||||
if echo "$file" | grep -E "^<|^>|^\." > /dev/null 2>&1; then
|
||||
# grep -E "^<|^>|^\." = Remove all lines that do not begin with '<', '>' or '.' to deal with a bizarre bug involving rsync 3.0.6 / CentOS 6 and --skip-compress showing 'adding zip' l$
|
||||
if echo "$file" | grep -E "^<|^>|^\.|^\*" > /dev/null 2>&1; then
|
||||
# Check for time attribute changes only (eg rsync output '.d..t......'
|
||||
if echo "$file" | grep -E "\..\.\.t\.\.\.\.\.\." > /dev/null 2>&1; then
|
||||
verb="TIMESTAMP"
|
||||
elif echo "$file" | grep -E "\*deleting" > /dev/null 2>&1; then
|
||||
verb="DELETE"
|
||||
if [ "$direction" == ">>" ]; then
|
||||
TARGET_DELETES_COUNT=$((TARGET_DELETES_COUNT+1))
|
||||
elif [ "$direction" == "<<" ]; then
|
||||
INITIATOR_DELETES_COUNT=$((INITIATOR_DELETES_COUNT+1))
|
||||
fi
|
||||
else
|
||||
verb="UPDATE"
|
||||
if [ "$direction" == ">>" ]; then
|
||||
TARGET_UPDATES_COUNT=$((TARGET_UPDATES_COUNT+1))
|
||||
elif [ "$direction" == "<<" ]; then
|
||||
INITIATOR_UPDATES_COUNT=$((INITIATOR_UPDATES_COUNT+1))
|
||||
fi
|
||||
fi
|
||||
# awk removes first part of line until space, then show all others
|
||||
# We don't use awk '$1="";print $0' since it would keep a space as first character
|
||||
Logger "+ $direction $replicaPath$(echo "$file" | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}')" "ALWAYS"
|
||||
if [ "$direction" == ">>" ]; then
|
||||
TARGET_UPDATES_COUNT=$((TARGET_UPDATES_COUNT+1))
|
||||
elif [ "$direction" == "<<" ]; then
|
||||
INITIATOR_UPDATES_COUNT=$((INITIATOR_UPDATES_COUNT+1))
|
||||
fi
|
||||
fi
|
||||
if echo "$file" | grep -E "\*deleting" > /dev/null 2>&1; then
|
||||
if [ "$direction" == ">>" ]; then
|
||||
Logger "- $direction $replicaPath$(echo "$file" | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}')" "ALWAYS"
|
||||
TARGET_DELETES_COUNT=$((TARGET_DELETES_COUNT+1))
|
||||
elif [ "$direction" == "<<" ]; then
|
||||
Logger "- $direction $replicaPath$(echo "$file" | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}')" "ALWAYS"
|
||||
INITIATOR_DELETES_COUNT=$((INITIATOR_DELETES_COUNT+1))
|
||||
fi
|
||||
Logger "$verb $direction $replicaPath$(echo "$file" | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}')" "ALWAYS"
|
||||
fi
|
||||
done < "$summaryFile"
|
||||
fi
|
||||
|
@ -5566,7 +5570,7 @@ function _SummaryFromDeleteFile {
|
|||
|
||||
if [ -f "$summaryFile" ]; then
|
||||
while read -r file; do
|
||||
Logger "- $direction $replicaPath$file" "ALWAYS"
|
||||
Logger "DELETE $direction $replicaPath$file" "ALWAYS"
|
||||
if [ "$direction" == ">>" ]; then
|
||||
TARGET_DELETES_COUNT=$((TARGET_DELETES_COUNT+1))
|
||||
elif [ "$direction" == "<<" ]; then
|
||||
|
|
Loading…
Reference in New Issue