diff --git a/script-config.sh b/script-config.sh index 9dbf019..323ed7f 100644 --- a/script-config.sh +++ b/script-config.sh @@ -132,11 +132,16 @@ FORCE_ZERO=0 # hd-idle is required and must be already configured. SPINDOWN=0 -# Increase verbosity of the email output. NOT RECOMMENDED! -# If set to 1, TOUCH and DIFF outputs will be kept in the email, producing -# a mostly unreadable email. You can always check TOUCH and DIFF outputs -# using the TMP file or use the feature RETENTION_DAYS. -# 1 to enable, any other value to disable. +# Increase verbosity of the email output. +# If set to 2, TOUCH and DIFF outputs will be kept in the email, when the +# threshold for deleted or updated files has been reached or exceeded and +# no sync was run because of that. In all other cases there will be a shorter, +# more readable email. +# NOT RECOMMENDED: If set to 1, TOUCH and DIFF outputs will always be kept +# in the email, producing a mostly unreadable email. +# You can always check TOUCH and DIFF outputs using the TMP file or use the feature +# RETENTION_DAYS. +# Set to any other value than 1 or 2 to disable increased verbosity completely (default) VERBOSITY=0 # SnapRAID detailed output retention for each run. diff --git a/snapraid-aio-script.sh b/snapraid-aio-script.sh index 28601fd..7ff6a37 100644 --- a/snapraid-aio-script.sh +++ b/snapraid-aio-script.sh @@ -359,7 +359,11 @@ fi # Add a topline to email body and send a long mail sed_me "1s:^:##$SUBJECT \n:" "${TMP_OUTPUT}" # send long mail if verbosity is set to 1 - if [ "$VERBOSITY" -eq 1 ]; then + if [ "$VERBOSITY" -eq 1 ]; then + send_mail < "$TMP_OUTPUT" + # send a long mail if the sync did not run due to failed checks (deleted or updated files threshold reached or exceeded) + # and verbosity is set to 2 + elif [ "$VERBOSITY" -eq 2 ] && [ "$CHK_FAIL" -eq 1 ] && [ "$DO_SYNC" -eq 0 ]; then send_mail < "$TMP_OUTPUT" else # or send a short mail