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

    Code
    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

    Code
    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

    Code
    /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?

  • 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

    Code
    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

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


    and no eMail


    EDIT2


    Tried to use the mail command standalone and this works

  • 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:


    Code
    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.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!