Minor fixes
This commit is contained in:
parent
354464495b
commit
0db693bbe6
|
@ -15,6 +15,7 @@ KNOWN ISSUES
|
||||||
RECENT CHANGES
|
RECENT CHANGES
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
- Improved verbose output
|
||||||
- Fixed various typos
|
- Fixed various typos
|
||||||
- Enforced CheckConnectivityRemoteHost and CheckConnectivity3rdPartyHosts checks (if one of these fails, osync is stopped)
|
- Enforced CheckConnectivityRemoteHost and CheckConnectivity3rdPartyHosts checks (if one of these fails, osync is stopped)
|
||||||
- 18 Aug. 2013: Osync 0.99 RC1
|
- 18 Aug. 2013: Osync 0.99 RC1
|
||||||
|
@ -26,7 +27,6 @@ RECENT CHANGES
|
||||||
- Added bandwidth limit
|
- Added bandwidth limit
|
||||||
- Update and delete functions now run rsync with --stats parameter
|
- Update and delete functions now run rsync with --stats parameter
|
||||||
- Fixed LoadConfigFile function will not warn on wrong config file
|
- Fixed LoadConfigFile function will not warn on wrong config file
|
||||||
- Without --verbose parameter, last sync details are still logged to /tmp/osync_(pid)
|
|
||||||
- Added --no-maxtime parameter for sync big changes without enforcing execution time checks
|
- Added --no-maxtime parameter for sync big changes without enforcing execution time checks
|
||||||
- 03 Aug. 2013: beta 3 milestone
|
- 03 Aug. 2013: beta 3 milestone
|
||||||
- Softdelete functions do now honor --dry switch
|
- Softdelete functions do now honor --dry switch
|
||||||
|
|
40
osync.sh
40
osync.sh
|
@ -4,7 +4,7 @@
|
||||||
###### Osync - Rsync based two way sync engine with fault tolerance
|
###### Osync - Rsync based two way sync engine with fault tolerance
|
||||||
###### (L) 2013 by Orsiris "Ozy" de Jong (www.netpower.fr)
|
###### (L) 2013 by Orsiris "Ozy" de Jong (www.netpower.fr)
|
||||||
OSYNC_VERSION=0.99preRC2
|
OSYNC_VERSION=0.99preRC2
|
||||||
OSYNC_BUILD=2408201301
|
OSYNC_BUILD=2508201301
|
||||||
|
|
||||||
DEBUG=no
|
DEBUG=no
|
||||||
SCRIPT_PID=$$
|
SCRIPT_PID=$$
|
||||||
|
@ -399,7 +399,7 @@ function CheckConnectivity3rdPartyHosts
|
||||||
ping $i -c 2 > /dev/null 2>&1
|
ping $i -c 2 > /dev/null 2>&1
|
||||||
if [ $? != 0 ]
|
if [ $? != 0 ]
|
||||||
then
|
then
|
||||||
LogError "Cannot ping 3rd party host $i"
|
Log "Cannot ping 3rd party host $i"
|
||||||
else
|
else
|
||||||
remote_3rd_party_success=1
|
remote_3rd_party_success=1
|
||||||
fi
|
fi
|
||||||
|
@ -795,17 +795,18 @@ function sync_update_slave
|
||||||
child_pid=$!
|
child_pid=$!
|
||||||
WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME
|
WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME
|
||||||
retval=$?
|
retval=$?
|
||||||
if [ $verbose -eq 1 ]
|
if [ $verbose -eq 1 ] && [ -f /dev/shm/osync_update_slave_replica_$SCRIPT_PID ]
|
||||||
then
|
then
|
||||||
Log "List:\n$(cat /dev/shm/osync_update_slave_replica_$SCRIPT_PID)"
|
Log "List:\n$(cat /dev/shm/osync_update_slave_replica_$SCRIPT_PID)"
|
||||||
else
|
|
||||||
echo "#### Update slave result" >> /tmp/osync_$SCRIPT_PID
|
|
||||||
cat /dev/shm/osync_update_slave_replica_$SCRIPT_PID >> /tmp/osync_$SCRIPT_PID
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $retval != 0 ]
|
if [ $retval != 0 ]
|
||||||
then
|
then
|
||||||
LogError "Updating slave replica failed. Stopping execution."
|
LogError "Updating slave replica failed. Stopping execution."
|
||||||
|
if [ $verbose -eq 0 ] && [ -f /dev/shm/osync_update_slave_replica_$SCRIPT_PID ]
|
||||||
|
then
|
||||||
|
LogError "Rsync output:\n$(cat /dev/shm/osync_update_slave_replica_$SCRIPT_PID)"
|
||||||
|
fi
|
||||||
echo "update-slave-replica.fail" > "$MASTER_STATE_DIR/last-action"
|
echo "update-slave-replica.fail" > "$MASTER_STATE_DIR/last-action"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
|
@ -833,16 +834,17 @@ function sync_update_master
|
||||||
child_pid=$!
|
child_pid=$!
|
||||||
WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME
|
WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME
|
||||||
retval=$?
|
retval=$?
|
||||||
if [ $verbose -eq 1 ]
|
if [ $verbose -eq 1 ] && [ -f /dev/shm/osync_update_master_replica_$SCRIPT_PID ]
|
||||||
then
|
then
|
||||||
Log "List:\n$(cat /dev/shm/osync_update_master_replica_$SCRIPT_PID)"
|
Log "List:\n$(cat /dev/shm/osync_update_master_replica_$SCRIPT_PID)"
|
||||||
else
|
|
||||||
echo "#### Update master result" >> /tmp/osync_$SCRIPT_PID
|
|
||||||
cat /dev/shm/osync_update_master_replica_$SCRIPT_PID >> /tmp/osync_$SCRIPT_PID
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $retval != 0 ]
|
if [ $retval != 0 ]
|
||||||
then
|
then
|
||||||
|
if [ $verbose -eq 0 ] && [ -f /dev/shm/osync_update_slave_replica_$SCRIPT_PID ]
|
||||||
|
then
|
||||||
|
LogError "Rsync output:\n$(cat /dev/shm/osync_update_slave_replica_$SCRIPT_PID)"
|
||||||
|
fi
|
||||||
LogError "Updating master replica failed. Stopping execution."
|
LogError "Updating master replica failed. Stopping execution."
|
||||||
echo "update-master-replica.fail" > "$MASTER_STATE_DIR/last-action"
|
echo "update-master-replica.fail" > "$MASTER_STATE_DIR/last-action"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -872,16 +874,17 @@ function delete_on_slave
|
||||||
child_pid=$!
|
child_pid=$!
|
||||||
WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME 0
|
WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME 0
|
||||||
retval=$?
|
retval=$?
|
||||||
if [ $verbose -eq 1 ]
|
if [ $verbose -eq 1 ] && [ -f /dev/shm/osync_deletion_on_slave_$SCRIPT_PID ]
|
||||||
then
|
then
|
||||||
Log "List:\n$(cat /dev/shm/osync_deletion_on_slave_$SCRIPT_PID)"
|
Log "List:\n$(cat /dev/shm/osync_deletion_on_slave_$SCRIPT_PID)"
|
||||||
else
|
|
||||||
echo "#### Deletion on slave result" >> /tmp/osync_$SCRIPT_PID
|
|
||||||
cat /dev/shm/osync_deletion_on_slave_$SCRIPT_PID >> /tmp/osync_$SCRIPT_PID
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $retval != 0 ]
|
if [ $retval != 0 ]
|
||||||
then
|
then
|
||||||
|
if [ $verbose -eq 0 ] && [ -f /dev/shm/osync_deletion_on_slave_$SCRIPT_PID ]
|
||||||
|
then
|
||||||
|
LogError "Rsync output:\n$(cat /dev/shm/osync_deletion_on_slave_$SCRIPT_PID)"
|
||||||
|
fi
|
||||||
LogError "Deletion on slave failed."
|
LogError "Deletion on slave failed."
|
||||||
echo "delete-propagation-slave.fail" > "$MASTER_STATE_DIR/last-action"
|
echo "delete-propagation-slave.fail" > "$MASTER_STATE_DIR/last-action"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -909,16 +912,17 @@ function delete_on_master
|
||||||
child_pid=$!
|
child_pid=$!
|
||||||
WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME 0
|
WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME 0
|
||||||
retval=$?
|
retval=$?
|
||||||
if [ $verbose -eq 1 ]
|
if [ $verbose -eq 1 ] && [ -f /dev/shm/osync_deletion_on_master_$SCRIPT_PID ]
|
||||||
then
|
then
|
||||||
Log "List:\n$(cat /dev/shm/osync_deletion_on_master_$SCRIPT_PID)"
|
Log "List:\n$(cat /dev/shm/osync_deletion_on_master_$SCRIPT_PID)"
|
||||||
else
|
|
||||||
echo "#### Deletion on master result" >> /tmp/osync_$SCRIPT_PID
|
|
||||||
cat /dev/shm/osync_deletion_on_master_$SCRIPT_PID >> /tmp/osync_$SCRIPT_PID
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $retval != 0 ]
|
if [ $retval != 0 ]
|
||||||
then
|
then
|
||||||
|
if [ $verbose -eq 0 ] && [ -f /dev/shm/osync_deletion_on_master_$SCRIPT_PID ]
|
||||||
|
then
|
||||||
|
LogError "Rsync output:\n$(cat /dev/shm/osync_deletion_on_master_$SCRIPT_PID)"
|
||||||
|
fi
|
||||||
LogError "Deletion on master failed."
|
LogError "Deletion on master failed."
|
||||||
echo "delete-propagation-master.fail" > "$MASTER_STATE_DIR/last-action"
|
echo "delete-propagation-master.fail" > "$MASTER_STATE_DIR/last-action"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in New Issue