auanasgheps / snapraid-aio-script

The definitive all-in-one SnapRAID script on Linux. Diff, sync, scrub are things of the past. Manage SnapRAID and much, much more!
GNU General Public License v3.0
225 stars 36 forks source link

Is there an option to stop including the entire list of files in the email? #108

Closed rpgdev closed 2 weeks ago

rpgdev commented 1 month ago

In case there isn't it'd be great to have the option to not include the list of files in the emails. Can be huge and as far as privacy one may not want to handle that list of files to third party services like email providers (gmail, etc.).

auanasgheps commented 1 month ago

Yes,

From the config file:

# 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.
VERBOSITY=0

But still, it's horrible and I don't recommend it. It's the main reason why I started working on my version of this script almost 4 years ago!

My goal for the future is to attach the list of changed files to the email.

rpgdev commented 1 month ago

I currently have that option disabled and I'm still getting the list of files in my emails. I want to stop including the list of files, the summary is enough for me (see image below). I don't need it attached, just need the option to exclude it entirely from what's being emailed. Everything else on the email is valuable information but I think it'd be useful to exclude that from the output being emailed (keeping it as a tmp file is good though). image

auanasgheps commented 1 month ago

Sorry I thought your initial ask was the opposite, to get back the full list.

What version are you using? You should not get any list of files!

You should get what you see in the readme of the repo. No list

rpgdev commented 1 month ago

image

I'm getting the usual, long list of files with the prefix of add, update, move, etc. below like always and I think that's the latest version of the script.

auanasgheps commented 1 month ago

This is unexpected, and I think it's an issue on your side.

Are you able to pull a clean config file and just change the really basic and try again?

auanasgheps commented 1 month ago

Also, change this section of the script from this

    # 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
      send_mail < "$TMP_OUTPUT"
    else
    # or send a short mail
      trim_log < "$TMP_OUTPUT" | send_mail

to:

    # 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
      echo "Verbosity option is set to 1, hence sending a full report"
      send_mail < "$TMP_OUTPUT"
    else
    # or send a short mail
      trim_log < "$TMP_OUTPUT" | send_mail

basically the echo line would confirm if the option is set to 1

rpgdev commented 1 month ago

This is unexpected, and I think it's an issue on your side.

Are you able to pull a clean config file and just change the really basic and try again?

I only changed basic settings in the config file, haven't touched the script. Will echo that line in the script now and let you know.

rpgdev commented 1 month ago

@auanasgheps the script failed after adding that line.

auanasgheps commented 1 month ago

What is the error? It should not fail because of a simple echo

rpgdev commented 1 month ago

False alarm, it was due to a unexpected zero file warning. Message is not being echoed, I'll add an echo for the other condition as well so it's clear.

auanasgheps commented 3 weeks ago

Hey, do you have an update on this?

rpgdev commented 2 weeks ago

@auanasgheps I stopped getting the file list, it seems I was mailing me the output of the command and that was including the files but the email the script itself sends doesn't seem to be sending the file list anymore.

auanasgheps commented 2 weeks ago

Perfect!