From 11da04272180227c3ddd169951fc2147eab50a69 Mon Sep 17 00:00:00 2001 From: deajan Date: Wed, 27 Jul 2016 10:56:25 +0200 Subject: [PATCH 1/4] Bumped version to v1.1 --- dev/debug_osync.sh | 13 +++++-------- dev/n_osync.sh | 9 +++------ dev/ofunctions.sh | 4 ++-- install.sh | 4 ++-- osync.sh | 13 +++++-------- 5 files changed, 17 insertions(+), 26 deletions(-) diff --git a/dev/debug_osync.sh b/dev/debug_osync.sh index 598cef6..03ae6c4 100755 --- a/dev/debug_osync.sh +++ b/dev/debug_osync.sh @@ -3,11 +3,11 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance AUTHOR="(C) 2013-2016 by Orsiris de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" -PROGRAM_VERSION=1.1-RC2 -PROGRAM_BUILD=2016071801 +PROGRAM_VERSION=1.1 +PROGRAM_BUILD=2016072701 IS_STABLE=yes -## FUNC_BUILD=2016071902 +## FUNC_BUILD=2016072701 ## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr ## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode @@ -47,7 +47,7 @@ fi #__WITH_PARANOIA_DEBUG ## allow debugging from command line with _DEBUG=yes if [ ! "$_DEBUG" == "yes" ]; then _DEBUG=no - SLEEP_TIME=.1 + SLEEP_TIME=.01 # Tested under linux bash / FreeBSD _VERBOSE=0 else SLEEP_TIME=1 @@ -2119,7 +2119,7 @@ function _delete_remote { exit 1 fi -$SSH_CMD ERROR_ALERT=0 sync_on_changes=$sync_on_changes _SILENT=$_SILENT _DEBUG=$_DEBUG _DRYRUN=$_DRYRUN _VERBOSE=$_VERBOSE COMMAND_SUDO=$COMMAND_SUDO FILE_LIST="$(EscapeSpaces "$TARGET_STATE_DIR/$deleted_list_file")" REPLICA_DIR="$(EscapeSpaces "$replica_dir")" DELETE_DIR="$(EscapeSpaces "$deletion_dir")" FAILED_DELETE_LIST="$(EscapeSpaces "${TARGET[1]}${TARGET[3]}/$deleted_failed_list_file")" 'bash -s' << 'ENDSSH' > "$RUN_DIR/$PROGRAM.remote_deletion.$SCRIPT_PID" 2>&1 & +$SSH_CMD ERROR_ALERT=0 sync_on_changes=$sync_on_changes _SILENT=$_SILENT _DEBUG=$_DEBUG _DRYRUN=$_DRYRUN _VERBOSE=$_VERBOSE COMMAND_SUDO=$COMMAND_SUDO FILE_LIST="$(EscapeSpaces "$TARGET_STATE_DIR/$deleted_list_file")" REPLICA_DIR="$(EscapeSpaces "$replica_dir")" DELETE_DIR="$(EscapeSpaces "$deletion_dir")" FAILED_DELETE_LIST="$(EscapeSpaces "${TARGET[1]}${TARGET[3]}/$deleted_failed_list_file")" 'bash -s' << 'ENDSSH' > "$RUN_DIR/$PROGRAM.remote_deletion.$SCRIPT_PID" 2>&1 ## The following lines are executed remotely function _logger { @@ -2222,9 +2222,6 @@ $SSH_CMD ERROR_ALERT=0 sync_on_changes=$sync_on_changes _SILENT=$_SILENT _DEBUG= IFS=$OLD_IFS ENDSSH - ## Need to add a trivial sleep time to give ssh time to log to local file - sleep 5 - ## Copy back the deleted failed file list esc_source_file="$(EscapeSpaces "${TARGET[1]}${TARGET[3]}/$deleted_failed_list_file")" rsync_cmd="$(type -p $RSYNC_EXECUTABLE) --rsync-path=\"$RSYNC_PATH\" $SYNC_OPTS -e \"$RSYNC_SSH_CMD\" $REMOTE_USER@$REMOTE_HOST:\"$esc_source_file\" \"${INITIATOR[1]}${INITIATOR[3]}\" > \"$RUN_DIR/$PROGRAM.remote_failed_deletion_list_copy.$SCRIPT_PID\"" diff --git a/dev/n_osync.sh b/dev/n_osync.sh index 643efae..4c8b563 100755 --- a/dev/n_osync.sh +++ b/dev/n_osync.sh @@ -3,8 +3,8 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance AUTHOR="(C) 2013-2016 by Orsiris de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" -PROGRAM_VERSION=1.1-RC2 -PROGRAM_BUILD=2016071801 +PROGRAM_VERSION=1.1 +PROGRAM_BUILD=2016072701 IS_STABLE=yes source "./ofunctions.sh" @@ -871,7 +871,7 @@ function _delete_remote { exit 1 fi -$SSH_CMD ERROR_ALERT=0 sync_on_changes=$sync_on_changes _SILENT=$_SILENT _DEBUG=$_DEBUG _DRYRUN=$_DRYRUN _VERBOSE=$_VERBOSE COMMAND_SUDO=$COMMAND_SUDO FILE_LIST="$(EscapeSpaces "$TARGET_STATE_DIR/$deleted_list_file")" REPLICA_DIR="$(EscapeSpaces "$replica_dir")" DELETE_DIR="$(EscapeSpaces "$deletion_dir")" FAILED_DELETE_LIST="$(EscapeSpaces "${TARGET[1]}${TARGET[3]}/$deleted_failed_list_file")" 'bash -s' << 'ENDSSH' > "$RUN_DIR/$PROGRAM.remote_deletion.$SCRIPT_PID" 2>&1 & +$SSH_CMD ERROR_ALERT=0 sync_on_changes=$sync_on_changes _SILENT=$_SILENT _DEBUG=$_DEBUG _DRYRUN=$_DRYRUN _VERBOSE=$_VERBOSE COMMAND_SUDO=$COMMAND_SUDO FILE_LIST="$(EscapeSpaces "$TARGET_STATE_DIR/$deleted_list_file")" REPLICA_DIR="$(EscapeSpaces "$replica_dir")" DELETE_DIR="$(EscapeSpaces "$deletion_dir")" FAILED_DELETE_LIST="$(EscapeSpaces "${TARGET[1]}${TARGET[3]}/$deleted_failed_list_file")" 'bash -s' << 'ENDSSH' > "$RUN_DIR/$PROGRAM.remote_deletion.$SCRIPT_PID" 2>&1 ## The following lines are executed remotely function _logger { @@ -974,9 +974,6 @@ $SSH_CMD ERROR_ALERT=0 sync_on_changes=$sync_on_changes _SILENT=$_SILENT _DEBUG= IFS=$OLD_IFS ENDSSH - ## Need to add a trivial sleep time to give ssh time to log to local file - sleep 5 - ## Copy back the deleted failed file list esc_source_file="$(EscapeSpaces "${TARGET[1]}${TARGET[3]}/$deleted_failed_list_file")" rsync_cmd="$(type -p $RSYNC_EXECUTABLE) --rsync-path=\"$RSYNC_PATH\" $SYNC_OPTS -e \"$RSYNC_SSH_CMD\" $REMOTE_USER@$REMOTE_HOST:\"$esc_source_file\" \"${INITIATOR[1]}${INITIATOR[3]}\" > \"$RUN_DIR/$PROGRAM.remote_failed_deletion_list_copy.$SCRIPT_PID\"" diff --git a/dev/ofunctions.sh b/dev/ofunctions.sh index 3b33ab1..1918237 100644 --- a/dev/ofunctions.sh +++ b/dev/ofunctions.sh @@ -1,4 +1,4 @@ -## FUNC_BUILD=2016071902 +## FUNC_BUILD=2016072701 ## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr ## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode @@ -38,7 +38,7 @@ fi #__WITH_PARANOIA_DEBUG ## allow debugging from command line with _DEBUG=yes if [ ! "$_DEBUG" == "yes" ]; then _DEBUG=no - SLEEP_TIME=.1 + SLEEP_TIME=.01 # Tested under linux bash / FreeBSD _VERBOSE=0 else SLEEP_TIME=1 diff --git a/install.sh b/install.sh index f69cafc..975acab 100755 --- a/install.sh +++ b/install.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash PROGRAM=osync -PROGRAM_VERSION=1.1-RC1 +PROGRAM_VERSION=1.1 PROGRAM_BINARY=$PROGRAM".sh" PROGRAM_BATCH=$PROGRAM"-batch.sh" -SCRIPT_BUILD=2016052601 +SCRIPT_BUILD=2016072701 ## osync / obackup / pmocr / zsnap install script ## Tested on RHEL / CentOS 6 & 7, Fedora 23, Debian 7 & 8, Mint 17 and FreeBSD 8 & 10 diff --git a/osync.sh b/osync.sh index cfd7ce1..2d180d3 100755 --- a/osync.sh +++ b/osync.sh @@ -3,11 +3,11 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance AUTHOR="(C) 2013-2016 by Orsiris de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" -PROGRAM_VERSION=1.1-RC2 -PROGRAM_BUILD=2016071801 +PROGRAM_VERSION=1.1 +PROGRAM_BUILD=2016072701 IS_STABLE=yes -## FUNC_BUILD=2016071902 +## FUNC_BUILD=2016072701 ## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr ## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode @@ -43,7 +43,7 @@ WARN_ALERT=0 ## allow debugging from command line with _DEBUG=yes if [ ! "$_DEBUG" == "yes" ]; then _DEBUG=no - SLEEP_TIME=.1 + SLEEP_TIME=.01 # Tested under linux bash / FreeBSD _VERBOSE=0 else SLEEP_TIME=1 @@ -2017,7 +2017,7 @@ function _delete_remote { exit 1 fi -$SSH_CMD ERROR_ALERT=0 sync_on_changes=$sync_on_changes _SILENT=$_SILENT _DEBUG=$_DEBUG _DRYRUN=$_DRYRUN _VERBOSE=$_VERBOSE COMMAND_SUDO=$COMMAND_SUDO FILE_LIST="$(EscapeSpaces "$TARGET_STATE_DIR/$deleted_list_file")" REPLICA_DIR="$(EscapeSpaces "$replica_dir")" DELETE_DIR="$(EscapeSpaces "$deletion_dir")" FAILED_DELETE_LIST="$(EscapeSpaces "${TARGET[1]}${TARGET[3]}/$deleted_failed_list_file")" 'bash -s' << 'ENDSSH' > "$RUN_DIR/$PROGRAM.remote_deletion.$SCRIPT_PID" 2>&1 & +$SSH_CMD ERROR_ALERT=0 sync_on_changes=$sync_on_changes _SILENT=$_SILENT _DEBUG=$_DEBUG _DRYRUN=$_DRYRUN _VERBOSE=$_VERBOSE COMMAND_SUDO=$COMMAND_SUDO FILE_LIST="$(EscapeSpaces "$TARGET_STATE_DIR/$deleted_list_file")" REPLICA_DIR="$(EscapeSpaces "$replica_dir")" DELETE_DIR="$(EscapeSpaces "$deletion_dir")" FAILED_DELETE_LIST="$(EscapeSpaces "${TARGET[1]}${TARGET[3]}/$deleted_failed_list_file")" 'bash -s' << 'ENDSSH' > "$RUN_DIR/$PROGRAM.remote_deletion.$SCRIPT_PID" 2>&1 ## The following lines are executed remotely function _logger { @@ -2120,9 +2120,6 @@ $SSH_CMD ERROR_ALERT=0 sync_on_changes=$sync_on_changes _SILENT=$_SILENT _DEBUG= IFS=$OLD_IFS ENDSSH - ## Need to add a trivial sleep time to give ssh time to log to local file - sleep 5 - ## Copy back the deleted failed file list esc_source_file="$(EscapeSpaces "${TARGET[1]}${TARGET[3]}/$deleted_failed_list_file")" rsync_cmd="$(type -p $RSYNC_EXECUTABLE) --rsync-path=\"$RSYNC_PATH\" $SYNC_OPTS -e \"$RSYNC_SSH_CMD\" $REMOTE_USER@$REMOTE_HOST:\"$esc_source_file\" \"${INITIATOR[1]}${INITIATOR[3]}\" > \"$RUN_DIR/$PROGRAM.remote_failed_deletion_list_copy.$SCRIPT_PID\"" From 135fd0b3263990f2aa196523bfae51a2708e94db Mon Sep 17 00:00:00 2001 From: deajan Date: Wed, 27 Jul 2016 10:57:50 +0200 Subject: [PATCH 2/4] Revert "Updated links to release" This reverts commit b2b8f508d6cf476402fd65265a00923c344e8b44. --- README.md | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 6902b4c..2001939 100644 --- a/README.md +++ b/README.md @@ -17,23 +17,24 @@ Osync provides the following capabilities - Directory monitoring - Running on schedule or as daemon - Batch runner for multiple sync tasks with rerun option for failed sync tasks -- ACL synchronization -osync uses a initiator / target sync schema. It can sync local to local or local to remote directories. By definition, initiator replica is always a local directory on the system osync runs on. -osync uses pidlocks to prevent multiple concurrent sync processes on/to the same initiator / target replica. -You may launch concurrent sync processes on the same system but only for different initiator replicas. -osync tasks may be launched sequentially by osync osync-batch tool. +Osync uses a master / slave sync schema. It can sync local to local or local to remote directories. By definition, master replica is always a local directory on the system osync runs on. +Osync uses pidlocks to prevent multiple concurrent sync processes on/to the same master / slave replica. Be sure a sync process is finished before launching next one, or use osync-batch. +You may launch concurrent sync processes on the same system but only for different master replicas. -Currently, it has been tested on CentOS 5.x, 6.x, 7.x, Debian 6, Debian 7, Linux Mint 14-17, Ubuntu 12.04, 12.10, FreeBSD 8.3, 10.1, 10.3, Mac OS X and pfSense. +Currently, it has been tested on CentOS 5.x, 6.x, 7.x, Debian 6.0.7, Linux Mint 14-17, Ubuntu 12.04 and 12.10, FreeBSD 8.3 and 10.1. Microsoft Windows is supported via MSYS or Cygwin. +Some users report osync to work on MacOS X too. ## Installation +Stable release is v1.1 and will be the last of v1 series. + Osync has been designed to not delete any data, but rather make backups of conflictual files or soft deletes. Nevertheless, you should always have a neat backup of your data before trying a new sync tool. -You can download the latest stable release of Osync at www.netpower.fr/osync or https://github.com/deajan/osync/archive/v1.1.tar.gz +You can download the latest stable release of Osync at www.netpower.fr/osync or https://github.com/deajan/osync/archive/v1.01.tar.gz You may also get the last development version at https://github.com/deajan/osync with the following command @@ -55,11 +56,11 @@ On MSYS, On top of your basic install, you need msys-rsync and msys-coreutils-ex Since osync v1.1 the config file format has changed in semantics and adds new config options. Also, master is now called initiator and slave is now called target. -You can upgrade all v1.0x-v1.1-dev config files by running the upgrade script +You can upgrade all v1.0x config files by running the upgrade script $ ./upgrade-v1.0x-v1.1x.sh /etc/osync/your-config-file.conf -The script will backup your config file, update it's content and try to connect to initiator and target replicas to update the state dir. +The script will backup your config file, update it's content and try to connect to master and remote replicas to update the state dir. ## Usage @@ -69,8 +70,8 @@ Please use double quotes as path delimiters. Do not use escaped characters in pa QuickSync example ----------------- - # osync.sh --initiator="/path/to/dir1" --target="/path/to/remote dir2" - # osync.sh --initiator="/path/to/another dir" --target="ssh://user@host.com:22//path/to/dir2" --rsakey=/home/user/.ssh/id_rsa_private_key_example.com + # osync.sh --master="/path/to/dir1" --slave="/path/to/remote dir2" + # osync.sh --master="/path/to/another dir" --slave="ssh://user@host.com:22//path/to/dir2" --rsakey=/home/user/.ssh/id_rsa_private_key_example.com Running osync with a Configuration file --------------------------------------- @@ -111,9 +112,9 @@ Having multiple conf files can then be run in a single cron command like Daemon mode ----------- -Additionnaly, you may run osync in monitor mode, which means it will perform a sync upon file operations on initiator replica. -This can be a drawback on functionnality versus scheduled mode because this mode only launches a sync task if there are file modifications on the initiator replica, without being able to monitor the target replica. -Target replica changes are only synced when initiator replica changes occur, or when a given amount of time (default 600 seconds) passed without any changes on initiator replica. +Additionnaly, you may run osync in monitor mode, which means it will perform a sync upon file operations on master replica. +This can be a drawback on functionnality versus scheduled mode because this mode only launches a sync task if there are file modifications on the master replica, without being able to monitor the slave replica. +Slave replica changes are only synced when master replica changes occur, or when a given amount of time (default 600 seconds) passed without any changes on master replica. File monitor mode can also be launched as a daemon with an init script. Please read the documentation for more info. Note that monitoring changes requires inotifywait command (inotify-tools package for most Linux distributions). BSD, MacOS X and Windows are not yet supported for this operation mode, unless you find a inotify-tools package on these OSes. @@ -133,10 +134,10 @@ Systemd specific (one service per config file) Troubleshooting --------------- -You may find osync's logs in /var/log/osync.*.log (or current directory if /var/log is not writable). +You may find osync's logs in /var/log/osync-*.log (or current directory if /var/log is not writable). Additionnaly, you can use the --verbose flag see to what actions are going on. ## Author Feel free to mail me for limited support in my free time :) -Orsiris de Jong | ozy@netpower.fr +Orsiris "Ozy" de Jong | ozy@netpower.fr From a45ebbe263a4aaabfc624c0286c6632bee64cb77 Mon Sep 17 00:00:00 2001 From: deajan Date: Wed, 27 Jul 2016 10:59:59 +0200 Subject: [PATCH 3/4] Revert "Revert "Updated links to release"" This reverts commit 135fd0b3263990f2aa196523bfae51a2708e94db. --- README.md | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 2001939..6902b4c 100644 --- a/README.md +++ b/README.md @@ -17,24 +17,23 @@ Osync provides the following capabilities - Directory monitoring - Running on schedule or as daemon - Batch runner for multiple sync tasks with rerun option for failed sync tasks +- ACL synchronization -Osync uses a master / slave sync schema. It can sync local to local or local to remote directories. By definition, master replica is always a local directory on the system osync runs on. -Osync uses pidlocks to prevent multiple concurrent sync processes on/to the same master / slave replica. Be sure a sync process is finished before launching next one, or use osync-batch. -You may launch concurrent sync processes on the same system but only for different master replicas. +osync uses a initiator / target sync schema. It can sync local to local or local to remote directories. By definition, initiator replica is always a local directory on the system osync runs on. +osync uses pidlocks to prevent multiple concurrent sync processes on/to the same initiator / target replica. +You may launch concurrent sync processes on the same system but only for different initiator replicas. +osync tasks may be launched sequentially by osync osync-batch tool. -Currently, it has been tested on CentOS 5.x, 6.x, 7.x, Debian 6.0.7, Linux Mint 14-17, Ubuntu 12.04 and 12.10, FreeBSD 8.3 and 10.1. +Currently, it has been tested on CentOS 5.x, 6.x, 7.x, Debian 6, Debian 7, Linux Mint 14-17, Ubuntu 12.04, 12.10, FreeBSD 8.3, 10.1, 10.3, Mac OS X and pfSense. Microsoft Windows is supported via MSYS or Cygwin. -Some users report osync to work on MacOS X too. ## Installation -Stable release is v1.1 and will be the last of v1 series. - Osync has been designed to not delete any data, but rather make backups of conflictual files or soft deletes. Nevertheless, you should always have a neat backup of your data before trying a new sync tool. -You can download the latest stable release of Osync at www.netpower.fr/osync or https://github.com/deajan/osync/archive/v1.01.tar.gz +You can download the latest stable release of Osync at www.netpower.fr/osync or https://github.com/deajan/osync/archive/v1.1.tar.gz You may also get the last development version at https://github.com/deajan/osync with the following command @@ -56,11 +55,11 @@ On MSYS, On top of your basic install, you need msys-rsync and msys-coreutils-ex Since osync v1.1 the config file format has changed in semantics and adds new config options. Also, master is now called initiator and slave is now called target. -You can upgrade all v1.0x config files by running the upgrade script +You can upgrade all v1.0x-v1.1-dev config files by running the upgrade script $ ./upgrade-v1.0x-v1.1x.sh /etc/osync/your-config-file.conf -The script will backup your config file, update it's content and try to connect to master and remote replicas to update the state dir. +The script will backup your config file, update it's content and try to connect to initiator and target replicas to update the state dir. ## Usage @@ -70,8 +69,8 @@ Please use double quotes as path delimiters. Do not use escaped characters in pa QuickSync example ----------------- - # osync.sh --master="/path/to/dir1" --slave="/path/to/remote dir2" - # osync.sh --master="/path/to/another dir" --slave="ssh://user@host.com:22//path/to/dir2" --rsakey=/home/user/.ssh/id_rsa_private_key_example.com + # osync.sh --initiator="/path/to/dir1" --target="/path/to/remote dir2" + # osync.sh --initiator="/path/to/another dir" --target="ssh://user@host.com:22//path/to/dir2" --rsakey=/home/user/.ssh/id_rsa_private_key_example.com Running osync with a Configuration file --------------------------------------- @@ -112,9 +111,9 @@ Having multiple conf files can then be run in a single cron command like Daemon mode ----------- -Additionnaly, you may run osync in monitor mode, which means it will perform a sync upon file operations on master replica. -This can be a drawback on functionnality versus scheduled mode because this mode only launches a sync task if there are file modifications on the master replica, without being able to monitor the slave replica. -Slave replica changes are only synced when master replica changes occur, or when a given amount of time (default 600 seconds) passed without any changes on master replica. +Additionnaly, you may run osync in monitor mode, which means it will perform a sync upon file operations on initiator replica. +This can be a drawback on functionnality versus scheduled mode because this mode only launches a sync task if there are file modifications on the initiator replica, without being able to monitor the target replica. +Target replica changes are only synced when initiator replica changes occur, or when a given amount of time (default 600 seconds) passed without any changes on initiator replica. File monitor mode can also be launched as a daemon with an init script. Please read the documentation for more info. Note that monitoring changes requires inotifywait command (inotify-tools package for most Linux distributions). BSD, MacOS X and Windows are not yet supported for this operation mode, unless you find a inotify-tools package on these OSes. @@ -134,10 +133,10 @@ Systemd specific (one service per config file) Troubleshooting --------------- -You may find osync's logs in /var/log/osync-*.log (or current directory if /var/log is not writable). +You may find osync's logs in /var/log/osync.*.log (or current directory if /var/log is not writable). Additionnaly, you can use the --verbose flag see to what actions are going on. ## Author Feel free to mail me for limited support in my free time :) -Orsiris "Ozy" de Jong | ozy@netpower.fr +Orsiris de Jong | ozy@netpower.fr From e90e03828f8e524d8f5e69c8bf238812a35b2723 Mon Sep 17 00:00:00 2001 From: deajan Date: Wed, 27 Jul 2016 11:00:39 +0200 Subject: [PATCH 4/4] Revert "Bumped version to v1.1" This reverts commit 11da04272180227c3ddd169951fc2147eab50a69. --- dev/debug_osync.sh | 13 ++++++++----- dev/n_osync.sh | 9 ++++++--- dev/ofunctions.sh | 4 ++-- install.sh | 4 ++-- osync.sh | 13 ++++++++----- 5 files changed, 26 insertions(+), 17 deletions(-) diff --git a/dev/debug_osync.sh b/dev/debug_osync.sh index 03ae6c4..598cef6 100755 --- a/dev/debug_osync.sh +++ b/dev/debug_osync.sh @@ -3,11 +3,11 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance AUTHOR="(C) 2013-2016 by Orsiris de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" -PROGRAM_VERSION=1.1 -PROGRAM_BUILD=2016072701 +PROGRAM_VERSION=1.1-RC2 +PROGRAM_BUILD=2016071801 IS_STABLE=yes -## FUNC_BUILD=2016072701 +## FUNC_BUILD=2016071902 ## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr ## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode @@ -47,7 +47,7 @@ fi #__WITH_PARANOIA_DEBUG ## allow debugging from command line with _DEBUG=yes if [ ! "$_DEBUG" == "yes" ]; then _DEBUG=no - SLEEP_TIME=.01 # Tested under linux bash / FreeBSD + SLEEP_TIME=.1 _VERBOSE=0 else SLEEP_TIME=1 @@ -2119,7 +2119,7 @@ function _delete_remote { exit 1 fi -$SSH_CMD ERROR_ALERT=0 sync_on_changes=$sync_on_changes _SILENT=$_SILENT _DEBUG=$_DEBUG _DRYRUN=$_DRYRUN _VERBOSE=$_VERBOSE COMMAND_SUDO=$COMMAND_SUDO FILE_LIST="$(EscapeSpaces "$TARGET_STATE_DIR/$deleted_list_file")" REPLICA_DIR="$(EscapeSpaces "$replica_dir")" DELETE_DIR="$(EscapeSpaces "$deletion_dir")" FAILED_DELETE_LIST="$(EscapeSpaces "${TARGET[1]}${TARGET[3]}/$deleted_failed_list_file")" 'bash -s' << 'ENDSSH' > "$RUN_DIR/$PROGRAM.remote_deletion.$SCRIPT_PID" 2>&1 +$SSH_CMD ERROR_ALERT=0 sync_on_changes=$sync_on_changes _SILENT=$_SILENT _DEBUG=$_DEBUG _DRYRUN=$_DRYRUN _VERBOSE=$_VERBOSE COMMAND_SUDO=$COMMAND_SUDO FILE_LIST="$(EscapeSpaces "$TARGET_STATE_DIR/$deleted_list_file")" REPLICA_DIR="$(EscapeSpaces "$replica_dir")" DELETE_DIR="$(EscapeSpaces "$deletion_dir")" FAILED_DELETE_LIST="$(EscapeSpaces "${TARGET[1]}${TARGET[3]}/$deleted_failed_list_file")" 'bash -s' << 'ENDSSH' > "$RUN_DIR/$PROGRAM.remote_deletion.$SCRIPT_PID" 2>&1 & ## The following lines are executed remotely function _logger { @@ -2222,6 +2222,9 @@ $SSH_CMD ERROR_ALERT=0 sync_on_changes=$sync_on_changes _SILENT=$_SILENT _DEBUG= IFS=$OLD_IFS ENDSSH + ## Need to add a trivial sleep time to give ssh time to log to local file + sleep 5 + ## Copy back the deleted failed file list esc_source_file="$(EscapeSpaces "${TARGET[1]}${TARGET[3]}/$deleted_failed_list_file")" rsync_cmd="$(type -p $RSYNC_EXECUTABLE) --rsync-path=\"$RSYNC_PATH\" $SYNC_OPTS -e \"$RSYNC_SSH_CMD\" $REMOTE_USER@$REMOTE_HOST:\"$esc_source_file\" \"${INITIATOR[1]}${INITIATOR[3]}\" > \"$RUN_DIR/$PROGRAM.remote_failed_deletion_list_copy.$SCRIPT_PID\"" diff --git a/dev/n_osync.sh b/dev/n_osync.sh index 4c8b563..643efae 100755 --- a/dev/n_osync.sh +++ b/dev/n_osync.sh @@ -3,8 +3,8 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance AUTHOR="(C) 2013-2016 by Orsiris de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" -PROGRAM_VERSION=1.1 -PROGRAM_BUILD=2016072701 +PROGRAM_VERSION=1.1-RC2 +PROGRAM_BUILD=2016071801 IS_STABLE=yes source "./ofunctions.sh" @@ -871,7 +871,7 @@ function _delete_remote { exit 1 fi -$SSH_CMD ERROR_ALERT=0 sync_on_changes=$sync_on_changes _SILENT=$_SILENT _DEBUG=$_DEBUG _DRYRUN=$_DRYRUN _VERBOSE=$_VERBOSE COMMAND_SUDO=$COMMAND_SUDO FILE_LIST="$(EscapeSpaces "$TARGET_STATE_DIR/$deleted_list_file")" REPLICA_DIR="$(EscapeSpaces "$replica_dir")" DELETE_DIR="$(EscapeSpaces "$deletion_dir")" FAILED_DELETE_LIST="$(EscapeSpaces "${TARGET[1]}${TARGET[3]}/$deleted_failed_list_file")" 'bash -s' << 'ENDSSH' > "$RUN_DIR/$PROGRAM.remote_deletion.$SCRIPT_PID" 2>&1 +$SSH_CMD ERROR_ALERT=0 sync_on_changes=$sync_on_changes _SILENT=$_SILENT _DEBUG=$_DEBUG _DRYRUN=$_DRYRUN _VERBOSE=$_VERBOSE COMMAND_SUDO=$COMMAND_SUDO FILE_LIST="$(EscapeSpaces "$TARGET_STATE_DIR/$deleted_list_file")" REPLICA_DIR="$(EscapeSpaces "$replica_dir")" DELETE_DIR="$(EscapeSpaces "$deletion_dir")" FAILED_DELETE_LIST="$(EscapeSpaces "${TARGET[1]}${TARGET[3]}/$deleted_failed_list_file")" 'bash -s' << 'ENDSSH' > "$RUN_DIR/$PROGRAM.remote_deletion.$SCRIPT_PID" 2>&1 & ## The following lines are executed remotely function _logger { @@ -974,6 +974,9 @@ $SSH_CMD ERROR_ALERT=0 sync_on_changes=$sync_on_changes _SILENT=$_SILENT _DEBUG= IFS=$OLD_IFS ENDSSH + ## Need to add a trivial sleep time to give ssh time to log to local file + sleep 5 + ## Copy back the deleted failed file list esc_source_file="$(EscapeSpaces "${TARGET[1]}${TARGET[3]}/$deleted_failed_list_file")" rsync_cmd="$(type -p $RSYNC_EXECUTABLE) --rsync-path=\"$RSYNC_PATH\" $SYNC_OPTS -e \"$RSYNC_SSH_CMD\" $REMOTE_USER@$REMOTE_HOST:\"$esc_source_file\" \"${INITIATOR[1]}${INITIATOR[3]}\" > \"$RUN_DIR/$PROGRAM.remote_failed_deletion_list_copy.$SCRIPT_PID\"" diff --git a/dev/ofunctions.sh b/dev/ofunctions.sh index 1918237..3b33ab1 100644 --- a/dev/ofunctions.sh +++ b/dev/ofunctions.sh @@ -1,4 +1,4 @@ -## FUNC_BUILD=2016072701 +## FUNC_BUILD=2016071902 ## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr ## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode @@ -38,7 +38,7 @@ fi #__WITH_PARANOIA_DEBUG ## allow debugging from command line with _DEBUG=yes if [ ! "$_DEBUG" == "yes" ]; then _DEBUG=no - SLEEP_TIME=.01 # Tested under linux bash / FreeBSD + SLEEP_TIME=.1 _VERBOSE=0 else SLEEP_TIME=1 diff --git a/install.sh b/install.sh index 975acab..f69cafc 100755 --- a/install.sh +++ b/install.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash PROGRAM=osync -PROGRAM_VERSION=1.1 +PROGRAM_VERSION=1.1-RC1 PROGRAM_BINARY=$PROGRAM".sh" PROGRAM_BATCH=$PROGRAM"-batch.sh" -SCRIPT_BUILD=2016072701 +SCRIPT_BUILD=2016052601 ## osync / obackup / pmocr / zsnap install script ## Tested on RHEL / CentOS 6 & 7, Fedora 23, Debian 7 & 8, Mint 17 and FreeBSD 8 & 10 diff --git a/osync.sh b/osync.sh index 2d180d3..cfd7ce1 100755 --- a/osync.sh +++ b/osync.sh @@ -3,11 +3,11 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance AUTHOR="(C) 2013-2016 by Orsiris de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" -PROGRAM_VERSION=1.1 -PROGRAM_BUILD=2016072701 +PROGRAM_VERSION=1.1-RC2 +PROGRAM_BUILD=2016071801 IS_STABLE=yes -## FUNC_BUILD=2016072701 +## FUNC_BUILD=2016071902 ## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr ## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode @@ -43,7 +43,7 @@ WARN_ALERT=0 ## allow debugging from command line with _DEBUG=yes if [ ! "$_DEBUG" == "yes" ]; then _DEBUG=no - SLEEP_TIME=.01 # Tested under linux bash / FreeBSD + SLEEP_TIME=.1 _VERBOSE=0 else SLEEP_TIME=1 @@ -2017,7 +2017,7 @@ function _delete_remote { exit 1 fi -$SSH_CMD ERROR_ALERT=0 sync_on_changes=$sync_on_changes _SILENT=$_SILENT _DEBUG=$_DEBUG _DRYRUN=$_DRYRUN _VERBOSE=$_VERBOSE COMMAND_SUDO=$COMMAND_SUDO FILE_LIST="$(EscapeSpaces "$TARGET_STATE_DIR/$deleted_list_file")" REPLICA_DIR="$(EscapeSpaces "$replica_dir")" DELETE_DIR="$(EscapeSpaces "$deletion_dir")" FAILED_DELETE_LIST="$(EscapeSpaces "${TARGET[1]}${TARGET[3]}/$deleted_failed_list_file")" 'bash -s' << 'ENDSSH' > "$RUN_DIR/$PROGRAM.remote_deletion.$SCRIPT_PID" 2>&1 +$SSH_CMD ERROR_ALERT=0 sync_on_changes=$sync_on_changes _SILENT=$_SILENT _DEBUG=$_DEBUG _DRYRUN=$_DRYRUN _VERBOSE=$_VERBOSE COMMAND_SUDO=$COMMAND_SUDO FILE_LIST="$(EscapeSpaces "$TARGET_STATE_DIR/$deleted_list_file")" REPLICA_DIR="$(EscapeSpaces "$replica_dir")" DELETE_DIR="$(EscapeSpaces "$deletion_dir")" FAILED_DELETE_LIST="$(EscapeSpaces "${TARGET[1]}${TARGET[3]}/$deleted_failed_list_file")" 'bash -s' << 'ENDSSH' > "$RUN_DIR/$PROGRAM.remote_deletion.$SCRIPT_PID" 2>&1 & ## The following lines are executed remotely function _logger { @@ -2120,6 +2120,9 @@ $SSH_CMD ERROR_ALERT=0 sync_on_changes=$sync_on_changes _SILENT=$_SILENT _DEBUG= IFS=$OLD_IFS ENDSSH + ## Need to add a trivial sleep time to give ssh time to log to local file + sleep 5 + ## Copy back the deleted failed file list esc_source_file="$(EscapeSpaces "${TARGET[1]}${TARGET[3]}/$deleted_failed_list_file")" rsync_cmd="$(type -p $RSYNC_EXECUTABLE) --rsync-path=\"$RSYNC_PATH\" $SYNC_OPTS -e \"$RSYNC_SSH_CMD\" $REMOTE_USER@$REMOTE_HOST:\"$esc_source_file\" \"${INITIATOR[1]}${INITIATOR[3]}\" > \"$RUN_DIR/$PROGRAM.remote_failed_deletion_list_copy.$SCRIPT_PID\""