From d6ebcbd55fe0c17c8523704ff3f6b320ada54166 Mon Sep 17 00:00:00 2001 From: deajan Date: Sun, 18 Aug 2013 13:15:40 +0200 Subject: [PATCH] Osync v0.99 RC1 --- CHANGELOG.md | 4 +++- osync.sh | 18 +++++++++++++----- sync.conf | 3 +++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4baacdb..1136284 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,11 +8,13 @@ FUTURE IMPROVEMENTS KNOWN ISSUES ------------ -- If master and remote slave systems don't have rsync in the same path, execution may fail (RSYNC_PATH is configured on master but also executed on slave) +- If master and remote slave systems don't have rsync in the same path, execution may fail (RSYNC_PATH is always configured on master, even when executed on slave) RECENT CHANGES -------------- +- 18 Aug. 2013: Osync 0.99 RC1 +- Added possibility to change default logfile - Fixed a possible error upon master replica lock check - Fixed exclude directorires with spaces in names generate errros on master replica tree functions - Dryruns won't create after run tree lists and therefore not prevent building real run delete lists diff --git a/osync.sh b/osync.sh index a31c7bf..b751460 100755 --- a/osync.sh +++ b/osync.sh @@ -3,9 +3,9 @@ ###### Osync - Rsync based two way sync engine with fault tolerance ###### (L) 2013 by Orsiris "Ozy" de Jong (www.netpower.fr) OSYNC_VERSION=0.99 -OSYNC_BUILD=0408201306 +OSYNC_BUILD=1808201302 -DEBUG=yes +DEBUG=no SCRIPT_PID=$$ LOCAL_USER=$(whoami) @@ -1288,7 +1288,13 @@ function Init trap 'TrapError ${LINENO} $?' ERR fi - LOG_FILE=/var/log/osync_$OSYNC_VERSION-$SYNC_ID.log + if [ "$LOGFILE" == "" ] + then + LOG_FILE=/var/log/osync_$OSYNC_VERSION-$SYNC_ID.log + else + LOG_FILE="$LOGFILE" + fi + MAIL_ALERT_MSG="Warning: Execution of osync instance $OSYNC_ID (pid $SCRIPT_PID) as $LOCAL_USER@$LOCAL_HOST produced errors." ## Rsync does not like spaces in directory names, considering it as two different directories. Handling this schema by escaping space @@ -1407,11 +1413,12 @@ function Usage { echo "Osync $OSYNC_VERSION $OSYNC_BUILD" echo "" - echo "usage: osync /path/to/conf.file [--dry] [--silent] [--verbose] [--force-unlock]" + echo "usage: osync /path/to/conf.file [--dry] [--silent] [--verbose] [--no-maxtime] [--force-unlock]" echo "" echo "--dry: will run osync without actuallyv doing anything; just testing" echo "--silent: will run osync without any output to stdout, usefull for cron jobs" echo "--verbose: adds command outputs" + echo "--no-maxtime: disables any soft and hard execution time checks" echo "--force-unlock: will override any existing active or dead locks on master and slave replica" exit 128 } @@ -1473,8 +1480,9 @@ then Init DATE=$(date) Log "-------------------------------------------------------------" - Log " $DRY_WARNING $DATE - Osync v$OSYNC_VERSION script begin." + Log "$DRY_WARNING $DATE - Osync v$OSYNC_VERSION script begin." Log "-------------------------------------------------------------" + Log "Backup task [$BACKUP_ID] launched as $LOCAL_USER@$LOCAL_HOST (PID $SCRIPT_PID)" if [ $no_maxtime -eq 1 ] then SOFT_MAX_EXEC_TIME=0 diff --git a/sync.conf b/sync.conf index 3ad48ed..a98ae99 100755 --- a/sync.conf +++ b/sync.conf @@ -7,6 +7,9 @@ ## Sync job identification, any string you want, no spaces SYNC_ID="sync_test" +## Leaving this empty will create a logfile at /var/log/obackup_version_BACKUP_ID.log +LOGFILE="" + ## Directories to synchronize MASTER_SYNC_DIR="/home/git/osync/test/dir1" SLAVE_SYNC_DIR="/home/git/osync/test/dir2"