diff --git a/CHANGELOG.md b/CHANGELOG.md index b73897a..622977e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,11 +8,14 @@ KNOWN ISSUES ------------ - Cannot finish sync if one replica contains a directory and the other replica contains a file named the same way (Unix doesn't allow this) +- Soft deletion does not honor exclusion lists + RECENT CHANGES -------------- ! XX Dec 2015: osync v1.1 released +- More fixes for GNU / non-GNU versions of mail command - Added bogus config file checks & environment checks - Added delta copies disable option - Revamped rsync patterns to allow include and exclude patterns diff --git a/dev/debug_osync.sh b/dev/debug_osync.sh index 9d2f044..de6bb26 100755 --- a/dev/debug_osync.sh +++ b/dev/debug_osync.sh @@ -7,7 +7,7 @@ PROGRAM_VERSION=1.1-pre PROGRAM_BUILD=2015112805 IS_STABLE=no -FUNC_BUILD=2015113001 +FUNC_BUILD=2015121501 ## BEGIN Generic functions for osync & obackup written in 2013-2015 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 @@ -278,7 +278,13 @@ function SendAlert { fi if type mail > /dev/null 2>&1 ; then - echo "$MAIL_ALERT_MSG" | $(type -p mail) -a "$ALERT_LOG_FILE" -s "$subject" $DESTINATION_MAILS + if $(type -p mail) -V | grep "GNU" > /dev/null; then echo ok; fi + attachment_command="-A $ALERT_LOG_FILE" + elif ($type -p mail) -V; then + attachment_command="-a $ALERT_LOG_FILE" + else + attachment_command="" + echo "$MAIL_ALERT_MSG" | $(type -p mail) $attachment_command -s "$subject" $DESTINATION_MAILS if [ $? != 0 ]; then Logger "WARNING: Cannot send alert email via $(type -p mail) with attachments !!!" "WARN" echo "$MAIL_ALERT_MSG" | $(type -p mail) -s "$subject" $DESTINATION_MAILS diff --git a/dev/ofunctions.sh b/dev/ofunctions.sh index 51f254b..957361f 100644 --- a/dev/ofunctions.sh +++ b/dev/ofunctions.sh @@ -1,4 +1,4 @@ -FUNC_BUILD=2015113001 +FUNC_BUILD=2015121501 ## BEGIN Generic functions for osync & obackup written in 2013-2015 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 @@ -269,7 +269,13 @@ function SendAlert { fi if type mail > /dev/null 2>&1 ; then - echo "$MAIL_ALERT_MSG" | $(type -p mail) -a "$ALERT_LOG_FILE" -s "$subject" $DESTINATION_MAILS + if $(type -p mail) -V | grep "GNU" > /dev/null; then echo ok; fi + attachment_command="-A $ALERT_LOG_FILE" + elif ($type -p mail) -V; then + attachment_command="-a $ALERT_LOG_FILE" + else + attachment_command="" + echo "$MAIL_ALERT_MSG" | $(type -p mail) $attachment_command -s "$subject" $DESTINATION_MAILS if [ $? != 0 ]; then Logger "WARNING: Cannot send alert email via $(type -p mail) with attachments !!!" "WARN" echo "$MAIL_ALERT_MSG" | $(type -p mail) -s "$subject" $DESTINATION_MAILS diff --git a/osync.sh b/osync.sh index ee97179..12e901e 100755 --- a/osync.sh +++ b/osync.sh @@ -7,7 +7,7 @@ PROGRAM_VERSION=1.1-pre PROGRAM_BUILD=2015112805 IS_STABLE=no -FUNC_BUILD=2015113001 +FUNC_BUILD=2015121501 ## BEGIN Generic functions for osync & obackup written in 2013-2015 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 @@ -266,7 +266,13 @@ function SendAlert { fi if type mail > /dev/null 2>&1 ; then - echo "$MAIL_ALERT_MSG" | $(type -p mail) -a "$ALERT_LOG_FILE" -s "$subject" $DESTINATION_MAILS + if $(type -p mail) -V | grep "GNU" > /dev/null; then echo ok; fi + attachment_command="-A $ALERT_LOG_FILE" + elif ($type -p mail) -V; then + attachment_command="-a $ALERT_LOG_FILE" + else + attachment_command="" + echo "$MAIL_ALERT_MSG" | $(type -p mail) $attachment_command -s "$subject" $DESTINATION_MAILS if [ $? != 0 ]; then Logger "WARNING: Cannot send alert email via $(type -p mail) with attachments !!!" "WARN" echo "$MAIL_ALERT_MSG" | $(type -p mail) -s "$subject" $DESTINATION_MAILS