From eb0bb0a3f871d6731c7f39e06dcee6633d88384d Mon Sep 17 00:00:00 2001 From: deajan Date: Sun, 25 Aug 2013 12:39:13 +0200 Subject: [PATCH] Minor fixes --- CHANGELOG.md | 8 +++++++- obackup.sh | 19 ++++++++++++------- obackup_ssh_filter.sh => ssh_filter.sh | 6 +++--- 3 files changed, 22 insertions(+), 11 deletions(-) rename obackup_ssh_filter.sh => ssh_filter.sh (91%) diff --git a/CHANGELOG.md b/CHANGELOG.md index baa657a..2c38298 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ## FUTURE IMPROVEMENTS +- Exit trap function must also stop child processes - Rewrite rsync exclude patterns using \"pattern\" instead of escaped chars +- Obackup should run on Cygwin ## Known issues @@ -8,8 +10,12 @@ ## Latest changelog +- Improved verbose output +- Improved dryrun output +- Improved remote connecivity detection +- Fixed a typo in configuration file - 18 Aug. 2013: Now v1.84 RC2 -- Added personalized log file option +- Added possibility to change default logfile - Simplified dryrun (removed dryrun function and merged it with main function) - Simplified Init function - Added --stat switch to rsync execution diff --git a/obackup.sh b/obackup.sh index da8c28e..61de018 100755 --- a/obackup.sh +++ b/obackup.sh @@ -3,7 +3,7 @@ ###### Remote (or local) backup script for files & databases ###### (L) 2013 by Orsiris "Ozy" de Jong (www.netpower.fr) OBACKUP_VERSION=1.84preRC3 -OBACKUP_BUILD=2408201302 +OBACKUP_BUILD=2508201301 DEBUG=no SCRIPT_PID=$$ @@ -797,7 +797,7 @@ function FilesBackup child_pid=$! WaitForTaskCompletion $child_pid $SOFT_MAX_EXEC_TIME_FILE_TASK $HARD_MAX_EXEC_TIME_FILE_TASK retval=$? - if [ $verbose -eq 1 ] + if [ $verbose -eq 1 ] && [ -f /dev/shm/obackup_rsync_output_$SCRIPT_PID ] then Log "List:\n$(cat /dev/shm/obackup_rsync_output_$SCRIPT_PID)" fi @@ -805,10 +805,10 @@ function FilesBackup if [ $retval -ne 0 ] then LogError "Backup failed on remote files." - if [ -f /dev/shm/obackup_rsync_output_$SCRIPT_PID ] - then - LogError "$(cat /dev/shm/obackup_rsync_output_$SCRIPT_PID)" - fi + if [ $verbose -eq 0 ] && [ -f /dev/shm/obackup_rsync_output_$SCRIPT_PID ] + then + LogError "$(cat /dev/shm/obackup_rsync_output_$SCRIPT_PID)" + fi else Log "Backup succeeded." fi @@ -824,10 +824,15 @@ function FilesBackup child_pid=$! WaitForTaskCompletion $child_pid $SOFT_MAX_EXEC_TIME_FILE_TASK $HARD_MAX_EXEC_TIME_FILE_TASK retval=$? + if [ $verbose -eq 1 ] && [ -f /dev/shm/obackup_rsync_output_$SCRIPT_PID ] + then + Log "List:\n$(cat /dev/shm/obackup_rsync_output_$SCRIPT_PID)" + fi + if [ $retval -ne 0 ] then LogError "Backup failed on remote files." - if [ -f /dev/shm/obackup_rsync_output_$SCRIPT_PID ] + if [ $verbose -eq 0 ] && [ -f /dev/shm/obackup_rsync_output_$SCRIPT_PID ] then LogError "$(cat /dev/shm/obackup_rsync_output_$SCRIPT_PID)" fi diff --git a/obackup_ssh_filter.sh b/ssh_filter.sh similarity index 91% rename from obackup_ssh_filter.sh rename to ssh_filter.sh index 0a555bf..a2fe09a 100755 --- a/obackup_ssh_filter.sh +++ b/ssh_filter.sh @@ -1,7 +1,7 @@ #!/bin/bash -##### Obackup ssh command filter build 2306201301 -##### This script should be located in /usr/local/bin in the remote system that will be backed up +##### Obackup / Osync ssh command filter build 2306201301 +##### This script should be located in /usr/local/bin in the remote system that will be backed up / synced ##### It will filter the commands that can be run remotely via ssh. ##### Please chmod 755 and chown root:root this file @@ -14,7 +14,7 @@ CMD1= CMD2= CMD3= -LOG_FILE=~/.ssh/obackup_ssh_filter.log +LOG_FILE=~/.ssh/ssh_filter.log function Log {