Fixed typo in soft deletion and added paranoia checksum

This commit is contained in:
deajan 2015-04-13 21:33:43 +02:00
parent aef10c2808
commit 2f827f9246
3 changed files with 11 additions and 3 deletions

View File

@ -31,6 +31,8 @@ UNDER WORK
RECENT CHANGES RECENT CHANGES
-------------- --------------
- Added optional checksum parameter for the paranoid :)
- 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
- Removed hardcoded program name from init script - Removed hardcoded program name from init script
- 01 Avr. 2015: Osync v1.00pre - 01 Avr. 2015: Osync v1.00pre

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=0104201503 PROGRAM_BUILD=1304201501
## 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
@ -1603,7 +1603,7 @@ function _SoftDelete
$FIND_CMD "$3/" -type f -ctime +$1 -print0 | xargs -0 -I {} echo "Will delete file {}" > $RUN_DIR/osync_soft_delete_slave_$SCRIPT_PID $FIND_CMD "$3/" -type f -ctime +$1 -print0 | xargs -0 -I {} echo "Will delete file {}" > $RUN_DIR/osync_soft_delete_slave_$SCRIPT_PID
Log "Command output:\n$(cat $RUN_DIR/osync_soft_delete_slave_$SCRIPT_PID)" Log "Command output:\n$(cat $RUN_DIR/osync_soft_delete_slave_$SCRIPT_PID)"
$FIND_CMD "$3/" -type d -empty -ctime +$1 -print0 | xargs -0 -I {} echo "Will delete directory {}" > $RUN_DIR/osync_soft_delete_slave_$SCRIPT_PID $FIND_CMD "$3/" -type d -empty -ctime +$1 -print0 | xargs -0 -I {} echo "Will delete directory {}" > $RUN_DIR/osync_soft_delete_slave_$SCRIPT_PID
Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID)" Log "Command output:\n$(cat $RUN_DIR/osync_soft_delete_slave_$SCRIPT_PID)"
Dummy & Dummy &
fi fi
if [ $dryrun -ne 1 ] if [ $dryrun -ne 1 ]
@ -1771,6 +1771,10 @@ function Init
then then
RSYNC_ARGS=$RSYNC_ARGS" -H" RSYNC_ARGS=$RSYNC_ARGS" -H"
fi fi
if [ "$CHECKSUM" == "yes" ]
then
RSYNC_ARGS=$RSYNC_ARGS" --checksum"
fi
if [ $dryrun -eq 1 ] if [ $dryrun -eq 1 ]
then then
RSYNC_ARGS=$RSYNC_ARGS" -n" RSYNC_ARGS=$RSYNC_ARGS" -n"

View File

@ -2,7 +2,7 @@
###### Osync - Rsync based two way sync engine with fault tolerance ###### Osync - Rsync based two way sync engine with fault tolerance
###### (L) 2013-2014 by Orsiris "Ozy" de Jong (www.netpower.fr) ###### (L) 2013-2014 by Orsiris "Ozy" de Jong (www.netpower.fr)
###### Config file rev 3003201501 ###### Config file rev 1304201501
## ---------- GENERAL OPTIONS ## ---------- GENERAL OPTIONS
@ -76,6 +76,8 @@ COPY_SYMLINKS=no
KEEP_DIRLINKS=no KEEP_DIRLINKS=no
## Preserve hard links. Make sure source and target FS can manage hard links or you will lose them. ## Preserve hard links. Make sure source and target FS can manage hard links or you will lose them.
PRESERVE_HARDLINKS=no PRESERVE_HARDLINKS=no
## Do a full checksum on all files that have identical sizes, they are checksummed to see if they actually are identical. This can take a long time.
CHECKSUM=no
## Let RSYNC compress file transfers. Do not use this if both master and slave replicas are on local system. Also, do not use this if you already enabled SSH compression. ## Let RSYNC compress file transfers. Do not use this if both master and slave replicas are on local system. Also, do not use this if you already enabled SSH compression.
RSYNC_COMPRESS=yes RSYNC_COMPRESS=yes