From e7af81de98d85c676ebd81af281ca44fa524a605 Mon Sep 17 00:00:00 2001 From: deajan Date: Sat, 28 Mar 2015 19:06:17 +0000 Subject: [PATCH 1/5] Reworked softdeletion code (WIP). Some other fixes too --- CHANGELOG.md | 8 +++- osync.sh | 119 ++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 91 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d5a40a..ee62587 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,12 +22,16 @@ UNDER WORK - sync test automation - See if find command could use -delete instead of exec rm (must check compat for BSD and MacOS) + - Portability needs find -print0 |xargs -0 -I {} command {} - Partial download is still experimental and needs more testing. -- Check the conflct backup and soft delete cleanup again RECENT CHANGES -------------- - + +- Replaced default script execution storage from /dev/shm to /tmp because some rootkit detection software doesn't like this +- Fixed bogus error in DEBUG for quicksync mode where no max execution time is set +- Reworked soft deletion code to handle a case where a top level directory gets deleted even if the files contained in it are not old enough (this obviously shouldn't happen on most FS) +- Added logging for soft deletion code - Prevent debug mode to send alert emails - Fixed an infamous bug introduced with exclude pattern globbing preventing multiple exludes to be processed - Fixed an issue with empty RSYNC_EXCLUDE_FILES diff --git a/osync.sh b/osync.sh index 6ba5cf0..566808f 100755 --- a/osync.sh +++ b/osync.sh @@ -3,8 +3,8 @@ PROGRAM="Osync" # Rsync based two way sync engine with fault tolerance AUTHOR="(L) 2013-2015 by Orsiris \"Ozy\" de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" -PROGRAM_VERSION=0.99RC4 -PROGRAM_BUILD=2003201502 +PROGRAM_VERSION=1.00pre +PROGRAM_BUILD=2603201504 ## 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 @@ -36,10 +36,7 @@ else fi ## Default directory where to store temporary run files -if [ -w /dev/shm ] -then - RUN_DIR=/dev/shm -elif [ -w /tmp ] +if [ -w /tmp ] then RUN_DIR=/tmp elif [ -w /var/tmp ] @@ -60,6 +57,12 @@ export LC_ALL=C ALERT_LOG_FILE=$RUN_DIR/osync_lastlog +function Dummy +{ + sleep 1 + exit 0 +} + function Log { if [ $sync_on_changes -eq 1 ] @@ -400,14 +403,14 @@ function WaitForTaskCompletion then Log "Current task still running." fi - if [ $EXEC_TIME -gt $2 ] + if [ $EXEC_TIME -gt "$2" ] then - if [ $soft_alert -eq 0 ] && [ $2 != 0 ] + if [ $soft_alert -eq 0 ] && [ "$2" != 0 ] then LogError "Max soft execution time exceeded for task." soft_alert=1 fi - if [ $EXEC_TIME -gt $3 ] && [ $3 != 0 ] + if [ $EXEC_TIME -gt "$3" ] && [ "$3" != 0 ] then LogError "Max hard execution time exceeded for task. Stopping task execution." kill -s SIGTERM $1 @@ -431,7 +434,7 @@ function WaitForTaskCompletion return $? } -# Waits for pid $1 to complete. Will log an alert if $2 seconds passed since script start unless $2 equals 0. +# Waits for pid $1 to complete. Will log an alert if $2 seconds passed since script start unless $2 equals 0. # Will stop task and log alert if $3 seconds passed since script start unless $3 equals 0. function WaitForCompletion { @@ -443,14 +446,14 @@ function WaitForCompletion then Log "Current task still running." fi - if [ $SECONDS -gt $2 ] + if [ $SECONDS -gt "$2" ] then - if [ $soft_alert -eq 0 ] && [ $2 != 0 ] + if [ $soft_alert -eq 0 ] && [ "$2" != 0 ] then LogError "Max soft execution time exceeded for script." soft_alert=1 fi - if [ $SECONDS -gt $3 ] && [ $3 != 0 ] + if [ $SECONDS -gt "$3" ] && [ "$3" != 0 ] then LogError "Max hard execution time exceeded for script. Stopping current task execution." kill -s SIGTERM $1 @@ -1494,18 +1497,26 @@ function SoftDelete if [ $dryrun -eq 1 ] then Log "Listing backups older than $CONFLICT_BACKUP_DAYS days on master replica. Won't remove anything." - if [ $verbose -eq 1 ] - then - $FIND_CMD "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" -ctime +$CONFLICT_BACKUP_DAYS & - else - $FIND_CMD "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" -ctime +$CONFLICT_BACKUP_DAYS > /dev/null & - fi else Log "Removing backups older than $CONFLICT_BACKUP_DAYS days on master replica." - $FIND_CMD "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" -ctime +$CONFLICT_BACKUP_DAYS -exec rm -rf '{}' \; & + fi + + if [ $verbose -eq 1 ] + then + # Cannot launch log function from xargs, ugly hack + $FIND_CMD "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" -type f -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} echo "Deleting file {}" > $RUN_DIR/osync_conflict_backup_$SCRIPT_PID + Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_$SCRIPT_PID)" + $FIND_CMD "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" -type d -empty -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} echo "Deleting directory {}" >> $RUN_DIR/osync_conflict_backup_$SCRIPT_PID + Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_$SCRIPT_PID)" + Dummy & + fi + + if [ $dryrun -ne 1 ] + then + $FIND_CMD "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" -type f -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} rm -f "{}" && $FIND_CMD "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" -type d -empty -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} rm -rf "{}" > $RUN_DIR/osync_conflict_backup_$SCRIPT_PID & fi child_pid=$! - WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME 0 + WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME retval=$? if [ $retval -ne 0 ] then @@ -1513,6 +1524,12 @@ function SoftDelete else Log "Conflict backup cleanup complete on master replica." fi + + if [ $verbose -eq 1 ] + then + Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_$SCRIPT_PID)" + fi + elif [ -d "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR" ] && ! [ -w "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR" ] then LogError "Warning: Master replica conflict backup dir [$MASTER_SYNC_DIR$MASTER_BACKUP_DIR] isn't writable. Cannot clean old files." @@ -1531,7 +1548,7 @@ function SoftDelete eval "$SSH_CMD \"if [ -w \\\"$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR\\\" ]; then $COMMAND_SUDO $REMOTE_FIND_CMD \\\"$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/\\\" -ctime +$CONFLICT_BACKUP_DAYS -exec rm -rf '{}' \;; fi\"" & fi child_pid=$! - WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME 0 + WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME retval=$? if [ $retval -ne 0 ] then @@ -1551,7 +1568,7 @@ function SoftDelete $FIND_CMD "$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/" -ctime +$CONFLICT_BACKUP_DAYS -exec rm -rf '{}' \; & fi child_pid=$! - WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME 0 + WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME retval=$? if [ $retval -ne 0 ] then @@ -1579,7 +1596,7 @@ function SoftDelete $FIND_CMD "$MASTER_SYNC_DIR$MASTER_DELETE_DIR/" -ctime +$SOFT_DELETE_DAYS -exec rm -rf '{}' \; & fi child_pid=$! - WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME 0 + WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME retval=$? if [ $retval -ne 0 ] then @@ -1605,7 +1622,7 @@ function SoftDelete eval "$SSH_CMD \"if [ -w \\\"$SLAVE_SYNC_DIR$SLAVE_DELETE_DIR\\\" ]; then $COMMAND_SUDO $REMOTE_FIND_CMD \\\"$SLAVE_SYNC_DIR$SLAVE_DELETE_DIR/\\\" -ctime +$SOFT_DELETE_DAYS -exec rm -rf '{}' \;; fi\"" & fi child_pid=$! - WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME 0 + WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME retval=$? if [ $retval -ne 0 ] then @@ -1626,7 +1643,7 @@ function SoftDelete $FIND_CMD "$SLAVE_SYNC_DIR$SLAVE_DELETE_DIR/" -ctime +$SOFT_DELETE_DAYS -exec rm -rf '{}' \; & fi child_pid=$! - WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME 0 + WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME retval=$? if [ $retval -ne 0 ] then @@ -1944,9 +1961,9 @@ function Usage echo $CONTACT echo "" echo "You may use Osync with a full blown configuration file, or use its default options for quick command line sync." - echo "Usage: osync /path/to/config/file [OPTIONS]" - echo "or osync --master=/path/to/master/replica --slave=/path/to/slave/replica [OPTIONS] [QUICKSYNC OPTIONS]" - echo "or osync --master=/path/to/master/replica --slave=ssh://backupuser@remotehost.com[:portnumber]//path/to/slave/replica [OPTIONS] [QUICKSYNC OPTIONS]" + echo "Usage: osync.sh /path/to/config/file [OPTIONS]" + echo "or osync.sh --master=/path/to/master/replica --slave=/path/to/slave/replica [OPTIONS] [QUICKSYNC OPTIONS]" + echo "or osync.sh --master=/path/to/master/replica --slave=ssh://backupuser@remotehost.com[:portnumber]//path/to/slave/replica [OPTIONS] [QUICKSYNC OPTIONS]" echo "" echo "[OPTIONS]" echo "--dry Will run osync without actually doing anything; just testing" @@ -1963,6 +1980,9 @@ function Usage echo "--slave=\"\" Local or remote slave replica path. Can be a ssh uri like ssh://user@host.com:22//path/to/slave/replica (is mandatory)" echo "--rsakey=\"\" Alternative path to rsa private key for ssh connection to slave replica" echo "--sync-id=\"\" Optional sync task name to identify this synchronization task when using multiple slaves" + echo "" + echo "Additionnaly, you may set most osync options at runtime. eg:" + echo "SOFT_DELETE_DAYS=365 osync.sh --master=/path --slave=/other/path" exit 128 } @@ -2108,12 +2128,41 @@ then then SYNC_ID="quicksync task" fi - MINIMUM_SPACE=1024 - REMOTE_SYNC=no - CONFLICT_BACKUP_DAYS=30 - SOFT_DELETE_DAYS=30 - RESUME_TRY=1 + + # Let the possibility to initialize those values directly via command line like SOFT_DELETE_DAYS=60 ./osync.sh + + if [ "$MINIMUM_SPACE" == "" ] + then + MINIMUM_SPACE=1024 + fi + + if [ "$CONFLICT_BACKUP_DAYS" == "" ] + then + CONFLICT_BACKUP_DAYS=30 + fi + + if [ "$SOFT_DELETE_DAYS" == "" ] + then + SOFT_DELETE_DAYS=30 + fi + + if [ "$RESUME_TRY" == "" ] + then + RESUME_TRY=1 + fi + + if [ "$SOFT_MAX_EXEC_TIME" == "" ] + then + SOFT_MAX_EXEC_TIME=0 + fi + + if [ "$HARD_MAX_EXEC_TIME" == "" ] + then + HARD_MAX_EXEC_TIME=0 + fi + MIN_WAIT=30 + REMOTE_SYNC=no else ConfigFile="$1" LoadConfigFile "$ConfigFile" @@ -2134,6 +2183,8 @@ then GetLocalOS InitLocalOSSettings Init + SoftDelete + exit 0 GetRemoteOS InitRemoteOSSettings if [ $sync_on_changes -eq 1 ] From 41781aa0da6aed74151fbc8a89c934dae3efda86 Mon Sep 17 00:00:00 2001 From: deajan Date: Mon, 30 Mar 2015 19:51:31 +0200 Subject: [PATCH 2/5] Some more work on soft deletion --- osync.sh | 86 ++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 56 insertions(+), 30 deletions(-) diff --git a/osync.sh b/osync.sh index 566808f..f577f99 100755 --- a/osync.sh +++ b/osync.sh @@ -4,7 +4,7 @@ PROGRAM="Osync" # Rsync based two way sync engine with fault tolerance AUTHOR="(L) 2013-2015 by Orsiris \"Ozy\" de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" PROGRAM_VERSION=1.00pre -PROGRAM_BUILD=2603201504 +PROGRAM_BUILD=3003201502 ## 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 @@ -17,7 +17,7 @@ fi if [ ! "$DEBUG" == "yes" ] then DEBUG=no - SLEEP_TIME=1 + SLEEP_TIME=.1 else SLEEP_TIME=3 fi @@ -59,8 +59,7 @@ ALERT_LOG_FILE=$RUN_DIR/osync_lastlog function Dummy { - sleep 1 - exit 0 + sleep .1 } function Log @@ -1504,16 +1503,17 @@ function SoftDelete if [ $verbose -eq 1 ] then # Cannot launch log function from xargs, ugly hack - $FIND_CMD "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" -type f -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} echo "Deleting file {}" > $RUN_DIR/osync_conflict_backup_$SCRIPT_PID - Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_$SCRIPT_PID)" - $FIND_CMD "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" -type d -empty -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} echo "Deleting directory {}" >> $RUN_DIR/osync_conflict_backup_$SCRIPT_PID - Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_$SCRIPT_PID)" - Dummy & + $FIND_CMD "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" -type f -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} echo "Will delete file {}" > $RUN_DIR/osync_conflict_backup_master_$SCRIPT_PID + Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_master_$SCRIPT_PID)" + $FIND_CMD "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" -type d -empty -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} echo "Will delete directory {}" > $RUN_DIR/osync_conflict_backup_master_$SCRIPT_PID + Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_master_$SCRIPT_PID)" fi if [ $dryrun -ne 1 ] then - $FIND_CMD "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" -type f -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} rm -f "{}" && $FIND_CMD "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" -type d -empty -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} rm -rf "{}" > $RUN_DIR/osync_conflict_backup_$SCRIPT_PID & + $FIND_CMD "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" -type f -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} rm -f "{}" && $FIND_CMD "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" -type d -empty -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} rm -rf "{}" > $RUN_DIR/osync_conflict_backup_master_$SCRIPT_PID & + else + Dummy & fi child_pid=$! WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME @@ -1521,15 +1521,11 @@ function SoftDelete if [ $retval -ne 0 ] then LogError "Error while executing conflict backup cleanup on master replica." + Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_master_$SCRIPT_PID)" else Log "Conflict backup cleanup complete on master replica." fi - if [ $verbose -eq 1 ] - then - Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_$SCRIPT_PID)" - fi - elif [ -d "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR" ] && ! [ -w "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR" ] then LogError "Warning: Master replica conflict backup dir [$MASTER_SYNC_DIR$MASTER_BACKUP_DIR] isn't writable. Cannot clean old files." @@ -1539,13 +1535,26 @@ function SoftDelete then CheckConnectivity3rdPartyHosts CheckConnectivityRemoteHost + if [ $dryrun -eq 1 ] then Log "Listing backups older than $CONFLICT_BACKUP_DAYS days on slave replica. Won't remove anything." - eval "$SSH_CMD \"if [ -w \\\"$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR\\\" ]; then $COMMAND_SUDO $REMOTE_FIND_CMD \\\"$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/\\\" -ctime +$CONFLICT_BACKUP_DAYS; fi\"" & else - Log "Removing backups older than $CONFLICT_BACKUP_DAYS days on remote slave replica." - eval "$SSH_CMD \"if [ -w \\\"$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR\\\" ]; then $COMMAND_SUDO $REMOTE_FIND_CMD \\\"$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/\\\" -ctime +$CONFLICT_BACKUP_DAYS -exec rm -rf '{}' \;; fi\"" & + Log "Removing backups older than $CONFLICT_BACKUP_DAYS days on slave replica." + fi + + if [ $verbose -eq 1 ] + then + # Cannot launch log function from xargs, ugly hack + eval "$SSH_CMD \"if [ -w \\\"$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR\\\" ]; then $COMMAND_SUDO $REMOTE_FIND_CMD \\\"$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/\\\" -type f -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} echo Will delete file {} && $REMOTE_FIND_CMD \\\"$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/\\\" -type d -empty -ctime $CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} echo Will delete directory {}; fi\"" > $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID + Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID)" + fi + + if [ $dryrun -ne 1 ] + then + eval "$SSH_CMD \"if [ -w \\\"$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR\\\" ]; then $COMMAND_SUDO $REMOTE_FIND_CMD \\\"$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/\\\" -type f -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} rm -f \\\"{}\\\" && $REMOTE_FIND_CMD \\\"$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/\\\" -type d -empty -ctime $CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} rm -rf \\\"{}\\\"; fi\"" > $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID & + else + Dummy & fi child_pid=$! WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME @@ -1553,6 +1562,8 @@ function SoftDelete if [ $retval -ne 0 ] then LogError "Error while executing conflict backup cleanup on slave replica." + Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID)" + else Log "Conflict backup cleanup complete on slave replica." fi @@ -1562,20 +1573,35 @@ function SoftDelete if [ $dryrun -eq 1 ] then Log "Listing backups older than $CONFLICT_BACKUP_DAYS days on slave replica. Won't remove anything." - $FIND_CMD "$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/" -ctime +$CONFLICT_BACKUP_DAYS & else Log "Removing backups older than $CONFLICT_BACKUP_DAYS days on slave replica." - $FIND_CMD "$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/" -ctime +$CONFLICT_BACKUP_DAYS -exec rm -rf '{}' \; & + fi + + if [ $verbose -eq 1 ] + then + # Cannot launch log function from xargs, ugly hack + $FIND_CMD "$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/" -type f -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} echo "Will delete file {}" > $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID + Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID)" + $FIND_CMD "$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/" -type d -empty -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} echo "Will delete directory {}" > $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID + Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID)" + Dummy & + fi + + if [ $dryrun -ne 1 ] + then + $FIND_CMD "$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/" -type f -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} rm -f "{}" && $FIND_CMD "$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/" -type d -empty -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} rm -rf "{}" > $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID & fi child_pid=$! - WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME - retval=$? - if [ $retval -ne 0 ] - then - LogError "Error while executing conflict backup cleanup on slave replica." - else - Log "Conflict backup cleanup complete on slave replica." - fi + WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME + retval=$? + if [ $retval -ne 0 ] + then + LogError "Error while executing conflict backup cleanup on slave replica." + Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID)" + else + Log "Conflict backup cleanup complete on slave replica." + fi + elif [ -d "$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR" ] && ! [ -w "$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR" ] then LogError "Warning: Slave replica conflict backup dir [$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR] isn't writable. Cannot clean old files." @@ -2183,10 +2209,10 @@ then GetLocalOS InitLocalOSSettings Init - SoftDelete - exit 0 GetRemoteOS InitRemoteOSSettings + SoftDelete + exit $? if [ $sync_on_changes -eq 1 ] then SyncOnChanges From f45086dad37ac06414eabe47791f099ba6733836 Mon Sep 17 00:00:00 2001 From: deajan Date: Tue, 31 Mar 2015 01:46:07 +0200 Subject: [PATCH 3/5] Refactored soft deletion code --- osync.sh | 279 +++++++++++++++++++++---------------------------------- 1 file changed, 104 insertions(+), 175 deletions(-) diff --git a/osync.sh b/osync.sh index f577f99..fed5621 100755 --- a/osync.sh +++ b/osync.sh @@ -4,7 +4,7 @@ PROGRAM="Osync" # Rsync based two way sync engine with fault tolerance AUTHOR="(L) 2013-2015 by Orsiris \"Ozy\" de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" PROGRAM_VERSION=1.00pre -PROGRAM_BUILD=3003201502 +PROGRAM_BUILD=3103201501 ## 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 @@ -1491,198 +1491,129 @@ function SoftDelete { if [ "$CONFLICT_BACKUP" != "no" ] && [ $CONFLICT_BACKUP_DAYS -ne 0 ] then - if [ -d "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR" ] - then - if [ $dryrun -eq 1 ] - then - Log "Listing backups older than $CONFLICT_BACKUP_DAYS days on master replica. Won't remove anything." - else - Log "Removing backups older than $CONFLICT_BACKUP_DAYS days on master replica." - fi + Log "Running conflict backup cleanup." + _SoftDelete $CONFLICT_BACKUP_DAYS "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" "$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/" + fi - if [ $verbose -eq 1 ] - then - # Cannot launch log function from xargs, ugly hack - $FIND_CMD "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" -type f -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} echo "Will delete file {}" > $RUN_DIR/osync_conflict_backup_master_$SCRIPT_PID - Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_master_$SCRIPT_PID)" - $FIND_CMD "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" -type d -empty -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} echo "Will delete directory {}" > $RUN_DIR/osync_conflict_backup_master_$SCRIPT_PID - Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_master_$SCRIPT_PID)" - fi + if [ "$SOFT_DELETE" != "no" ] && [ $SOFT_DELETE_DAYS -ne 0 ] + then + Log "Running soft deletion cleanup." + _SoftDelete $SOFT_DELETE_DAYS "$MASTER_SYNC_DIR$MASTER_DELETE_DIR/" "$SLAVE_SYNC_DIR$SLAVE_DELETE_DIR/" + fi +} - if [ $dryrun -ne 1 ] - then - $FIND_CMD "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" -type f -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} rm -f "{}" && $FIND_CMD "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" -type d -empty -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} rm -rf "{}" > $RUN_DIR/osync_conflict_backup_master_$SCRIPT_PID & - else - Dummy & - fi - child_pid=$! - WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME - retval=$? - if [ $retval -ne 0 ] - then - LogError "Error while executing conflict backup cleanup on master replica." - Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_master_$SCRIPT_PID)" - else - Log "Conflict backup cleanup complete on master replica." - fi - elif [ -d "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR" ] && ! [ -w "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR" ] +# Takes 3 arguments +# $1 = ctime (CONFLICT_BACKUP_DAYS or SOFT_DELETE_DAYS), $2 = MASTER_(BACKUP/DELETED)_DIR, $3 = SLAVE_(BACKUP/DELETED)_DIR +function _SoftDelete +{ + if [ -d "$2" ] + then + if [ $dryrun -eq 1 ] then - LogError "Warning: Master replica conflict backup dir [$MASTER_SYNC_DIR$MASTER_BACKUP_DIR] isn't writable. Cannot clean old files." + Log "Listing files older than $1 days on master replica. Won't remove anything." + else + Log "Removing files older than $1 days on master replica." fi - - if [ "$REMOTE_SYNC" == "yes" ] - then - CheckConnectivity3rdPartyHosts - CheckConnectivityRemoteHost - - if [ $dryrun -eq 1 ] - then - Log "Listing backups older than $CONFLICT_BACKUP_DAYS days on slave replica. Won't remove anything." - else - Log "Removing backups older than $CONFLICT_BACKUP_DAYS days on slave replica." - fi - if [ $verbose -eq 1 ] - then - # Cannot launch log function from xargs, ugly hack - eval "$SSH_CMD \"if [ -w \\\"$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR\\\" ]; then $COMMAND_SUDO $REMOTE_FIND_CMD \\\"$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/\\\" -type f -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} echo Will delete file {} && $REMOTE_FIND_CMD \\\"$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/\\\" -type d -empty -ctime $CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} echo Will delete directory {}; fi\"" > $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID - Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID)" - fi - + then + # Cannot launch log function from xargs, ugly hack + $FIND_CMD "$2/" -type f -ctime +$1 -print0 | xargs -0 -I {} echo "Will delete file {}" > $RUN_DIR/osync_soft_delete_master_$SCRIPT_PID + Log "Command output:\n$(cat $RUN_DIR/osync_soft_delete_master_$SCRIPT_PID)" + $FIND_CMD "$2/" -type d -empty -ctime +$1 -print0 | xargs -0 -I {} echo "Will delete directory {}" > $RUN_DIR/osync_soft_delete_master_$SCRIPT_PID + Log "Command output:\n$(cat $RUN_DIR/osync_soft_delete_master_$SCRIPT_PID)" + fi if [ $dryrun -ne 1 ] - then - eval "$SSH_CMD \"if [ -w \\\"$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR\\\" ]; then $COMMAND_SUDO $REMOTE_FIND_CMD \\\"$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/\\\" -type f -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} rm -f \\\"{}\\\" && $REMOTE_FIND_CMD \\\"$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/\\\" -type d -empty -ctime $CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} rm -rf \\\"{}\\\"; fi\"" > $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID & - else - Dummy & - fi - child_pid=$! - WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME - retval=$? - if [ $retval -ne 0 ] - then - LogError "Error while executing conflict backup cleanup on slave replica." - Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID)" - - else - Log "Conflict backup cleanup complete on slave replica." - fi + then + $FIND_CMD "$2/" -type f -ctime +$1 -print0 | xargs -0 -I {} rm -f "{}" && $FIND_CMD "$2/" -type d -empty -ctime +$1 -print0 | xargs -0 -I {} rm -rf "{}" > $RUN_DIR/osync_soft_delete_master_$SCRIPT_PID & else - if [ -w "$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR" ] - then - if [ $dryrun -eq 1 ] - then - Log "Listing backups older than $CONFLICT_BACKUP_DAYS days on slave replica. Won't remove anything." - else - Log "Removing backups older than $CONFLICT_BACKUP_DAYS days on slave replica." - fi - - if [ $verbose -eq 1 ] - then - # Cannot launch log function from xargs, ugly hack - $FIND_CMD "$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/" -type f -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} echo "Will delete file {}" > $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID - Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID)" - $FIND_CMD "$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/" -type d -empty -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} echo "Will delete directory {}" > $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID - Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID)" - Dummy & - fi - - if [ $dryrun -ne 1 ] - then - $FIND_CMD "$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/" -type f -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} rm -f "{}" && $FIND_CMD "$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/" -type d -empty -ctime +$CONFLICT_BACKUP_DAYS -print0 | xargs -0 -I {} rm -rf "{}" > $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID & - fi - child_pid=$! - WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME - retval=$? - if [ $retval -ne 0 ] - then - LogError "Error while executing conflict backup cleanup on slave replica." - Log "Command output:\n$(cat $RUN_DIR/osync_conflict_backup_slave_$SCRIPT_PID)" - else - Log "Conflict backup cleanup complete on slave replica." - fi - - elif [ -d "$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR" ] && ! [ -w "$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR" ] - then - LogError "Warning: Slave replica conflict backup dir [$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR] isn't writable. Cannot clean old files." - fi + Dummy & + fi + child_pid=$! + WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME + retval=$? + if [ $retval -ne 0 ] + then + LogError "Error while executing cleanup on master replica." + Log "Command output:\n$(cat $RUN_DIR/osync_soft_delete_master_$SCRIPT_PID)" + else + Log "Cleanup complete on master replica." fi + elif [ -d "$2" ] && ! [ -w "$2" ] + then + LogError "Warning: Master replica dir [$2] isn't writable. Cannot clean old files." fi - if [ "$SOFT_DELETE" != "no" ] && [ $SOFT_DELETE_DAYS -ne 0 ] + if [ "$REMOTE_SYNC" == "yes" ] then - if [ -d "$MASTER_SYNC_DIR$MASTER_DELETE_DIR" ] - then + CheckConnectivity3rdPartyHosts + CheckConnectivityRemoteHost if [ $dryrun -eq 1 ] - then - Log "Listing soft deleted items older than $SOFT_DELETE_DAYS days on master replica. Won't remove anything." - $FIND_CMD "$MASTER_SYNC_DIR$MASTER_DELETE_DIR/" -ctime +$SOFT_DELETE_DAYS & - else - Log "Removing soft deleted items older than $SOFT_DELETE_DAYS days on master replica." - $FIND_CMD "$MASTER_SYNC_DIR$MASTER_DELETE_DIR/" -ctime +$SOFT_DELETE_DAYS -exec rm -rf '{}' \; & - fi - child_pid=$! - WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME - retval=$? - if [ $retval -ne 0 ] - then - LogError "Error while executing soft delete cleanup on master replica." - else - Log "Soft delete cleanup complete on master replica." - fi - elif [ -d "$MASTER_SYNC_DIR$MASTER_DELETE_DIR" ] && ! [ -w "$MASTER_SYNC_DIR$MASTER_DELETE_DIR" ] then - LogError "Warning: Master replica deletion backup dir [$MASTER_SYNC_DIR$MASTER_DELETE_DIR] isn't writable. Cannot clean old files." + Log "Listing files older than $1 days on slave replica. Won't remove anything." + else + Log "Removing files older than $1 days on slave replica." fi - - if [ "$REMOTE_SYNC" == "yes" ] + if [ $verbose -eq 1 ] then - CheckConnectivity3rdPartyHosts - CheckConnectivityRemoteHost - if [ $dryrun -eq 1 ] - then - Log "Listing soft deleted items older than $SOFT_DELETE_DAYS days on slave replica. Won't remove anything." - eval "$SSH_CMD \"if [ -w \\\"$SLAVE_SYNC_DIR$SLAVE_DELETE_DIR\\\" ]; then $COMMAND_SUDO $REMOTE_FIND_CMD \\\"$SLAVE_SYNC_DIR$SLAVE_DELETE_DIR/\\\" -ctime +$SOFT_DELETE_DAYS; fi\"" & - else - Log "Removing soft deleted items older than $SOFT_DELETE_DAYS days on remote slave replica." - eval "$SSH_CMD \"if [ -w \\\"$SLAVE_SYNC_DIR$SLAVE_DELETE_DIR\\\" ]; then $COMMAND_SUDO $REMOTE_FIND_CMD \\\"$SLAVE_SYNC_DIR$SLAVE_DELETE_DIR/\\\" -ctime +$SOFT_DELETE_DAYS -exec rm -rf '{}' \;; fi\"" & - fi - child_pid=$! - WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME - retval=$? - if [ $retval -ne 0 ] - then - LogError "Error while executing soft delete cleanup on slave replica." + # Cannot launch log function from xargs, ugly hack + eval "$SSH_CMD \"if [ -w \\\"$3\\\" ]; then $COMMAND_SUDO $REMOTE_FIND_CMD \\\"$3/\\\" -type f -ctime +$1 -print0 | xargs -0 -I {} echo Will delete file {} && $REMOTE_FIND_CMD \\\"$3/\\\" -type d -empty -ctime $1 -print0 | xargs -0 -I {} echo Will delete directory {}; fi\"" > $RUN_DIR/osync_soft_delete_slave_$SCRIPT_PID + Log "Command output:\n$(cat $RUN_DIR/osync_soft_delete_slave_$SCRIPT_PID)" + fi + if [ $dryrun -ne 1 ] + then + eval "$SSH_CMD \"if [ -w \\\"$3\\\" ]; then $COMMAND_SUDO $REMOTE_FIND_CMD \\\"$3/\\\" -type f -ctime +$1 -print0 | xargs -0 -I {} rm -f \\\"{}\\\" && $REMOTE_FIND_CMD \\\"$3/\\\" -type d -empty -ctime $1 -print0 | xargs -0 -I {} rm -rf \\\"{}\\\"; fi\"" > $RUN_DIR/osync_soft_delete_slave_$SCRIPT_PID & + else + Dummy & + fi + child_pid=$! + WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME + retval=$? + if [ $retval -ne 0 ] + then + LogError "Error while executing cleanup on slave replica." + Log "Command output:\n$(cat $RUN_DIR/osync_soft_delete_slave_$SCRIPT_PID)" else - Log "Soft delete cleanup complete on slave replica." - fi - + Log "Cleanup complete on slave replica." + fi + else + if [ -w "$3" ] + then + if [ $dryrun -eq 1 ] + then + Log "Listing files older than $1 days on slave replica. Won't remove anything." else - if [ -w "$SLAVE_SYNC_DIR$SLAVE_DELETE_DIR" ] - then - if [ $dryrun -eq 1 ] - then - Log "Listing soft deleted items older than $SOFT_DELETE_DAYS days on slave replica. Won't remove anything." - $FIND_CMD "$SLAVE_SYNC_DIR$SLAVE_DELETE_DIR/" -ctime +$SOFT_DELETE_DAYS & - else - Log "Removing soft deleted items older than $SOFT_DELETE_DAYS days on slave replica." - $FIND_CMD "$SLAVE_SYNC_DIR$SLAVE_DELETE_DIR/" -ctime +$SOFT_DELETE_DAYS -exec rm -rf '{}' \; & - fi - child_pid=$! - WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME - retval=$? - if [ $retval -ne 0 ] - then - LogError "Error while executing soft delete cleanup on slave replica." - else - Log "Soft delete cleanup complete on slave replica." - fi - elif [ -d "$SLAVE_SYNC_DIR$SLAVE_DELETE_DIR" ] && ! [ -w "$SLAVE_SYNC_DIR$SLAVE_DELETE_DIR" ] - then - LogError "Warning: Slave replica deletion backup dir [$SLAVE_SYNC_DIR$SLAVE_DELETE_DIR] isn't writable. Cannot clean old files." - fi + Log "Removing files older than $1 days on slave replica." + fi + if [ $verbose -eq 1 ] + then + # Cannot launch log function from xargs, ugly hack + $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)" + $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)" + Dummy & + fi + if [ $dryrun -ne 1 ] + then + $FIND_CMD "$3/" -type f -ctime +$1 -print0 | xargs -0 -I {} rm -f "{}" && $FIND_CMD "$3/" -type d -empty -ctime +$1 -print0 | xargs -0 -I {} rm -rf "{}" > $RUN_DIR/osync_soft_delete_slave_$SCRIPT_PID & + fi + child_pid=$! + WaitForCompletion $child_pid $SOFT_MAX_EXEC_TIME $HARD_MAX_EXEC_TIME + retval=$? + if [ $retval -ne 0 ] + then + LogError "Error while executing cleanup on slave replica." + Log "Command output:\n$(cat $RUN_DIR/osync_soft_delete_slave_$SCRIPT_PID)" + else + Log "Cleanup complete on slave replica." + fi + elif [ -d "$3" ] && ! [ -w "$3" ] + then + LogError "Warning: Slave replica dir [$3] isn't writable. Cannot clean old files." fi fi + } function Init @@ -2211,8 +2142,6 @@ then Init GetRemoteOS InitRemoteOSSettings - SoftDelete - exit $? if [ $sync_on_changes -eq 1 ] then SyncOnChanges From bf39522b23e1d494de66fe39818059799c8ea9ed Mon Sep 17 00:00:00 2001 From: deajan Date: Wed, 1 Apr 2015 10:34:40 +0200 Subject: [PATCH 4/5] Removed extra slash for soft deletion --- osync.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osync.sh b/osync.sh index fed5621..1654a38 100755 --- a/osync.sh +++ b/osync.sh @@ -4,7 +4,7 @@ PROGRAM="Osync" # Rsync based two way sync engine with fault tolerance AUTHOR="(L) 2013-2015 by Orsiris \"Ozy\" de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" PROGRAM_VERSION=1.00pre -PROGRAM_BUILD=3103201501 +PROGRAM_BUILD=0104201501 ## 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 @@ -1492,13 +1492,13 @@ function SoftDelete if [ "$CONFLICT_BACKUP" != "no" ] && [ $CONFLICT_BACKUP_DAYS -ne 0 ] then Log "Running conflict backup cleanup." - _SoftDelete $CONFLICT_BACKUP_DAYS "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR/" "$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR/" + _SoftDelete $CONFLICT_BACKUP_DAYS "$MASTER_SYNC_DIR$MASTER_BACKUP_DIR" "$SLAVE_SYNC_DIR$SLAVE_BACKUP_DIR" fi if [ "$SOFT_DELETE" != "no" ] && [ $SOFT_DELETE_DAYS -ne 0 ] then Log "Running soft deletion cleanup." - _SoftDelete $SOFT_DELETE_DAYS "$MASTER_SYNC_DIR$MASTER_DELETE_DIR/" "$SLAVE_SYNC_DIR$SLAVE_DELETE_DIR/" + _SoftDelete $SOFT_DELETE_DAYS "$MASTER_SYNC_DIR$MASTER_DELETE_DIR" "$SLAVE_SYNC_DIR$SLAVE_DELETE_DIR" fi } From 51c68314667daf6e6733e7ce56c7467650629b57 Mon Sep 17 00:00:00 2001 From: deajan Date: Wed, 1 Apr 2015 10:36:38 +0200 Subject: [PATCH 5/5] Updated changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee62587..f9db35f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,12 +22,13 @@ UNDER WORK - sync test automation - See if find command could use -delete instead of exec rm (must check compat for BSD and MacOS) - - Portability needs find -print0 |xargs -0 -I {} command {} + - Portability needs find -print0 |xargs -0 -I {} command {} (tested on FreeBSD 10 so far) - Partial download is still experimental and needs more testing. RECENT CHANGES -------------- +- Improved and refactoed the soft deletion routine by merging conflict backup and soft deletion - Replaced default script execution storage from /dev/shm to /tmp because some rootkit detection software doesn't like this - Fixed bogus error in DEBUG for quicksync mode where no max execution time is set - Reworked soft deletion code to handle a case where a top level directory gets deleted even if the files contained in it are not old enough (this obviously shouldn't happen on most FS)