|
|
|
@ -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-RC1
|
|
|
|
|
PROGRAM_BUILD=2016070601
|
|
|
|
|
PROGRAM_VERSION=1.1-RC2
|
|
|
|
|
PROGRAM_BUILD=2016071801
|
|
|
|
|
IS_STABLE=yes
|
|
|
|
|
|
|
|
|
|
## FUNC_BUILD=2016052602
|
|
|
|
|
## FUNC_BUILD=2016070601
|
|
|
|
|
## 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
|
|
|
|
@ -363,7 +363,7 @@ function SendAlert {
|
|
|
|
|
# smtp_server.domain.tld is mandatory, as is smtp_port (should be 25, 465 or 587)
|
|
|
|
|
# encryption can be set to tls, ssl or none
|
|
|
|
|
# smtp_user and smtp_password are optional
|
|
|
|
|
# SendEmail "subject" "Body text" "receiver@example.com receiver2@otherdomain.com" "/path/to/attachment.file" "sender_email@example.com" "smtp_server.domain.tld" "smtp_port" "encrpytion" "smtp_user" "smtp_password"
|
|
|
|
|
# SendEmail "subject" "Body text" "receiver@example.com receiver2@otherdomain.com" "/path/to/attachment.file" "sender_email@example.com" "smtp_server.domain.tld" "smtp_port" "encryption" "smtp_user" "smtp_password"
|
|
|
|
|
function SendEmail {
|
|
|
|
|
local subject="${1}"
|
|
|
|
|
local message="${2}"
|
|
|
|
@ -372,7 +372,7 @@ function SendEmail {
|
|
|
|
|
local sender_email="${5}"
|
|
|
|
|
local smtp_server="${6}"
|
|
|
|
|
local smtp_port="${7}"
|
|
|
|
|
local encrpytion="${8}"
|
|
|
|
|
local encryption="${8}"
|
|
|
|
|
local smtp_user="${9}"
|
|
|
|
|
local smtp_password="${10}"
|
|
|
|
|
|
|
|
|
@ -1953,7 +1953,7 @@ function sync_attrs {
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ $retval != 0 ] && [ $retval != 24 ]; then
|
|
|
|
|
Logger "Updating file attributes on $source [$retval]. Stopping execution." "CRITICAL"
|
|
|
|
|
Logger "Updating file attributes on $dest_replica [$retval]. Stopping execution." "CRITICAL"
|
|
|
|
|
if [ $_VERBOSE -eq 0 ] && [ -f "$RUN_DIR/$PROGRAM.attr-update.$dest_replica.$SCRIPT_PID" ]; then
|
|
|
|
|
Logger "Rsync output:\n$(cat $RUN_DIR/$PROGRAM.attr-update.$dest_replica.$SCRIPT_PID)" "NOTICE"
|
|
|
|
|
fi
|
|
|
|
|