Can't receive emails apart from new access to the Web ui

  • What do these cron jobs run? Are you certain they produce any output (assuming they finish without errors)?

    I made a little bash script that runs some sar command. I wanted to receive the output via mail, but I had to specify the mail command manually In my script to receive the output via mail.


    Maybe you could point me to a command example to test.


    Tried with a single command "date". It is executed successfully but no email is sent.


    Also all the jobs in /etc/cron.d/openmediavault-user-defined are followed by: >/dev/null 2>&1.

  • Um, if you append >/dev/null 2>&1, you're not going to get any emails. You do realize this part means "send any output to nowhere," as in ignore and discard it... so you have to remove that part and then you should get emails.

  • Um, if you append >/dev/null 2>&1, you're not going to get any emails. You do realize this part means "send any output to nowhere," as in ignore and discard it... so you have to remove that part and then you should get emails.

    That s appended automatically when I create the cron jobs even if I select to send emails after the cron job completes, searching for the forum I found that directory and looked inside and found out that. No idea why.

  • Also all the jobs in /etc/cron.d/openmediavault-user-defined are followed by: >/dev/null 2>&1.

    This is an example for a job, where I do get email


    Code
    @reboot root /var/lib/openmediavault/cron.d/userdefined-a1f698b4-a295-4ea3-b7f9-6683a8d07cc0 2>&1 | mail -E -s "Cron" -a "From: Cron Daemon <root>" root >/dev/null 2>&1
  • Ahhh, this is different. The commandline output of the mail command is being redirected to /dev/null, which is completely different. (The output of your scheduled job is being piped into the mail command, so that it gets sent as an email.)


    So that's all in order.


    Just out of curiosity, though, can you show the other jobs that aren't producing email output?

  • Here you go (complete content)


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!