Fixed function lib path.
This commit is contained in:
parent
30f6a36109
commit
d32699c492
|
@ -4,10 +4,10 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance
|
||||||
AUTHOR="(L) 2013-2015 by Orsiris \"Ozy\" de Jong"
|
AUTHOR="(L) 2013-2015 by Orsiris \"Ozy\" de Jong"
|
||||||
CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr"
|
CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr"
|
||||||
PROGRAM_VERSION=1.1-pre
|
PROGRAM_VERSION=1.1-pre
|
||||||
PROGRAM_BUILD=2015111601
|
PROGRAM_BUILD=2015111901
|
||||||
IS_STABLE=no
|
IS_STABLE=no
|
||||||
|
|
||||||
source "/home/git/common/ofunctions.sh"
|
source "./ofunctions.sh"
|
||||||
|
|
||||||
## Working directory. This is the name of the osync subdirectory contained in every replica.
|
## Working directory. This is the name of the osync subdirectory contained in every replica.
|
||||||
OSYNC_DIR=".osync_workdir"
|
OSYNC_DIR=".osync_workdir"
|
||||||
|
@ -1270,7 +1270,6 @@ function Usage {
|
||||||
echo $AUTHOR
|
echo $AUTHOR
|
||||||
echo $CONTACT
|
echo $CONTACT
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "\e[41mWARNING: This is an unstable dev build\e[0m"
|
|
||||||
echo "You may use osync with a full blown configuration file, or use its default options for quick command line sync."
|
echo "You may use osync with a full blown configuration file, or use its default options for quick command line sync."
|
||||||
echo "Usage: osync.sh /path/to/config/file [OPTIONS]"
|
echo "Usage: osync.sh /path/to/config/file [OPTIONS]"
|
||||||
echo "or osync.sh --initiator=/path/to/initiator/replica --target=/path/to/target/replica [OPTIONS] [QUICKSYNC OPTIONS]"
|
echo "or osync.sh --initiator=/path/to/initiator/replica --target=/path/to/target/replica [OPTIONS] [QUICKSYNC OPTIONS]"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FUNC_BUILD=2015111102
|
FUNC_BUILD=2015111901
|
||||||
## BEGIN Generic functions for osync & obackup written in 2013-2015 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
|
## 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
|
## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode
|
||||||
|
@ -249,7 +249,7 @@ function SendAlert {
|
||||||
# </OSYNC SPECIFIC>
|
# </OSYNC SPECIFIC>
|
||||||
|
|
||||||
eval "cat \"$LOG_FILE\" $COMPRESSION_PROGRAM > $ALERT_LOG_FILE"
|
eval "cat \"$LOG_FILE\" $COMPRESSION_PROGRAM > $ALERT_LOG_FILE"
|
||||||
MAIL_ALERT_MSG="$MAIL_ALERT_MSG"$'\n\n'$(tail -n 25 "$LOG_FILE")
|
MAIL_ALERT_MSG="$MAIL_ALERT_MSG"$'\n\n'$(tail -n 50 "$LOG_FILE")
|
||||||
if [ $ERROR_ALERT -eq 1 ]; then
|
if [ $ERROR_ALERT -eq 1 ]; then
|
||||||
subject="Error alert for $INSTANCE_ID"
|
subject="Error alert for $INSTANCE_ID"
|
||||||
elif [ $WARN_ALERT -eq 1 ]; then
|
elif [ $WARN_ALERT -eq 1 ]; then
|
||||||
|
@ -541,8 +541,9 @@ function RunLocalCommand {
|
||||||
|
|
||||||
if [ $_DRYRUN -ne 0 ]; then
|
if [ $_DRYRUN -ne 0 ]; then
|
||||||
Logger "Dryrun: Local command [$command] not run." "NOTICE"
|
Logger "Dryrun: Local command [$command] not run." "NOTICE"
|
||||||
return 1
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
Logger "Running command [$command] on local host." "NOTICE"
|
Logger "Running command [$command] on local host." "NOTICE"
|
||||||
eval "$command" > "$RUN_DIR/$PROGRAM.$FUNCNAME.$SCRIPT_PID" 2>&1 &
|
eval "$command" > "$RUN_DIR/$PROGRAM.$FUNCNAME.$SCRIPT_PID" 2>&1 &
|
||||||
WaitForTaskCompletion $! 0 $hard_max_time $FUNCNAME
|
WaitForTaskCompletion $! 0 $hard_max_time $FUNCNAME
|
||||||
|
@ -573,8 +574,9 @@ function RunRemoteCommand {
|
||||||
CheckConnectivityRemoteHost
|
CheckConnectivityRemoteHost
|
||||||
if [ $_DRYRUN -ne 0 ]; then
|
if [ $_DRYRUN -ne 0 ]; then
|
||||||
Logger "Dryrun: Local command [$command] not run." "NOTICE"
|
Logger "Dryrun: Local command [$command] not run." "NOTICE"
|
||||||
return 1
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
Logger "Running command [$command] on remote host." "NOTICE"
|
Logger "Running command [$command] on remote host." "NOTICE"
|
||||||
cmd=$SSH_CMD' "$command" > "'$RUN_DIR/$PROGRAM.$FUNCNAME.$SCRIPT_PID'" 2>&1'
|
cmd=$SSH_CMD' "$command" > "'$RUN_DIR/$PROGRAM.$FUNCNAME.$SCRIPT_PID'" 2>&1'
|
||||||
Logger "cmd: $cmd" "DEBUG"
|
Logger "cmd: $cmd" "DEBUG"
|
||||||
|
|
Loading…
Reference in New Issue