Update do-backup for userdirs. Remove ''s around from= for mailx.

This commit is contained in:
Darren 'Tadgy' Austin 2023-11-06 15:35:26 +00:00
commit 25394932fb
4 changed files with 41 additions and 10 deletions

View file

@ -55,7 +55,7 @@ if (( "$ERR" == 0 )); then
# The size of the log file determines if it gets emailed.
(( $(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 || \
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; RET=1; }
Exit code: $ERR
Logfile: $LOGSDIR/$LOGFILE.gz
@ -71,7 +71,7 @@ else
# Mirroring failed, tell the admin.
[[ -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 || \
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; RET=1; }
Exit code: $ERR
Logfile: $LOGSDIR/$LOGFILE.gz