diff --git a/do-mirroring b/do-mirroring index 76f384c..944466b 100755 --- a/do-mirroring +++ b/do-mirroring @@ -8,8 +8,8 @@ # Configuration. COMMAND="/opt/bin/mirror" -LOGSDIR="/var/log/mirroring/$(printf "%(%Y/%m)T")" -LOGFILE="$(printf "%(%Y%m%d-%H%M%S)T")-mirroring-$$" +LOGSDIR="/var/log/duplication/mirroring/$(printf "%(%Y/%m)T")" +LOGFILE="$(printf "%(%Y%m%d-%H%M%S)T")-$$" MIN_LOGFILE_SIZE="550" # Only allow one copy of the script to run at any time. @@ -56,7 +56,7 @@ if (( "$ERR" == 0 )); then (( $(stat --printf="%s" "$LOGSDIR/$LOGFILE") > MIN_LOGFILE_SIZE )) && { if [[ -n "${EMAIL_TO[*]}" ]]; then mailx "${MAILX_ARGS[@]}" -S "from='$EMAIL_FROM'" -s "Mirroring report" "${EMAIL_TO[@]}" <<-EOF 2>/dev/null || \ - printf "%s: %s\\n" "${0##*/}" "mailx command failed" >&2 + { printf "%s: %s\\n" "${0##*/}" "mailx command failed" >&2; RET=1; } Exit code: $ERR Logfile: $LOGSDIR/$LOGFILE.gz Output: @@ -72,7 +72,7 @@ else [[ -x "/opt/bin/pushover" ]] && CONFIG_FILE="mirroring" /opt/bin/pushover -T "Mirroring" -p '-1' -m "Mirroring failed" if [[ -n "${EMAIL_TO[*]}" ]]; then mailx "${MAILX_ARGS[@]}" -S "from='$EMAIL_FROM'" -s "Mirroring failure" "${EMAIL_TO[@]}" <<-EOF 2>/dev/null || \ - printf "%s: %s\\n" "${0##*/}" "mailx command failed" >&2 + { printf "%s: %s\\n" "${0##*/}" "mailx command failed" >&2; RET=1; } Exit code: $ERR Logfile: $LOGSDIR/$LOGFILE.gz Output: diff --git a/do-sbosrcarch b/do-sbosrcarch index 1cbaf88..e762b39 100755 --- a/do-sbosrcarch +++ b/do-sbosrcarch @@ -8,8 +8,8 @@ # Configuration. COMMAND="/opt/bin/sbosrcarch" -LOGSDIR="/var/log/mirroring/$(printf "%(%Y/%m)T")" -LOGFILE="$(printf "%(%Y%m%d-%H%M%S)T")-sbosrcharch-$$" +LOGSDIR="/var/log/duplication/sbosrcarch/$(printf "%(%Y/%m)T")" +LOGFILE="$(printf "%(%Y%m%d-%H%M%S)T")-$$" # Only allow one copy of the script to run at any time. # shellcheck disable=SC2154 @@ -54,7 +54,7 @@ printf "\\n" >>"$LOGSDIR/$LOGFILE" if (( "$ERR" == 0 )); then if [[ -n "${EMAIL_TO[*]}" ]]; then mailx "${MAILX_ARGS[@]}" -S "from='$EMAIL_FROM'" -s "SBosrcarch report" "${EMAIL_TO[@]}" <<-EOF 2>/dev/null || \ - printf "%s: %s\\n" "${0##*/}" "mailx command failed" >&2 + { printf "%s: %s\\n" "${0##*/}" "mailx command failed" >&2; RET=1; } Exit code: $ERR Logfile: $LOGSDIR/$LOGFILE.gz Output: @@ -69,7 +69,7 @@ else [[ -x "/opt/bin/pushover" ]] && CONFIG_FILE="mirroring" /opt/bin/pushover -T "SBosrcarch" -p '-1' -m "SBosrcarch failed" if [[ -n "${EMAIL_TO[*]}" ]]; then mailx "${MAILX_ARGS[@]}" -S "from='$EMAIL_FROM'" -s "SBosrcarch failure" "${EMAIL_TO[@]}" <<-EOF 2>/dev/null || \ - printf "%s: %s\\n" "${0##*/}" "mailx command failed" >&2 + { printf "%s: %s\\n" "${0##*/}" "mailx command failed" >&2; RET=1; } Exit code: $ERR Logfile: $LOGSDIR/$LOGFILE.gz Output: