Don't recieve notifications from planned jobs

    • OMV 2.x
    • Don't recieve notifications from planned jobs

      Hi,

      I have a HP Gen8 G1610T with OMV installed on it. Today I tried to setup a planned job for download my homepage. The command itself is working properly but I don't get any notification although I have activated this option. (I recieved the test mail and some stuff about the usage of my disks so it should work).

      This is the command

      Source Code

      1. sshpass -p 'PASSWORD' scp -v -r USER@www366.your-server.de:/public_html /media/a18237a2-7cfb-4289-8d63-caf80079f80a/Homepage_Data3


      the crontab shows this line

      Source Code

      1. 57 16 * * * root /var/lib/openmediavault/cron.d/userdefined-5f0768d7-5522-4887-a30f-7207cc8fa7f4 | mail -E -s "Cron - HP backup" -a "From: Cron Daemon <root>" root >/dev/null 2>&1


      The

      Source Code

      1. /dev/null 2>&1
      part is always there, not matter if the option is checked or not. Guess this is wrong but what can I do?
    • Your assumption is correct, i have to check that.
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • The

      Source Code

      1. >/dev/null 2>&1
      part is only for the mail command, but not for the command to be executed. What happens if you execute the command in the CLI?
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • the command is working but it would be nice if I could get a "feedback" (like a mail) for this. A workaround would be a small script but hopefully I can avoid this.

      Edit:
      the command

      Source Code

      1. sshpass -p 'PASSWORD' scp -v -r USER@www366.your-server.de:/public_html /media/a18237a2-7cfb-4289-8d63-caf80079f80a/Homepage_Data3 | mail -E -s "Cron - HP backup" -a "From: Cron Daemon <root>" root


      output

      Source Code

      1. debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
      2. debug1: channel 0: free: client-session, nchannels 1
      3. debug1: fd 0 clearing O_NONBLOCK
      4. debug1: fd 1 clearing O_NONBLOCK
      5. Transferred: sent 722136, received 599433280 bytes, in 565.6 seconds
      6. Bytes per second: sent 1276.9, received 1059895.8
      7. debug1: Exit status 0


      and no eMail

      EDIT2

      Tried to use the mail command standalone and this works

      The post was edited 3 times, last by MoritzJ ().

    • Well not sure but it seems that the output has been too much for the "mail" client. This command works very well but I still have the problem with the "/dev/null" stuff:

      Source Code

      1. sshpass -p 'PASSWORD' scp -v -r USERNAME@www366.your-server.de:/public_html /media/a18237a2-7cfb-4289-8d63-caf80079f80a/Homepage_Data3 2> /var/log/scplog.txt; if [ $? -ne 0 ]; then echo "Critical error -- Please check log file"; else echo "SCP download successfull"; fi | mail -E -s "Cron - HP backup" -a "From: Cron Daemon <root>" root


      I recieve a mail with either one of these messages. For now I unchecked the notification stuff and added the mail command manually like shown above.