Scheduled jobs not sending output to email

  • I have multiple scheduled jobs running as root user and set to send their output via email. However, even though the job does run and there is output, I never receive the output via email. See the attached screenshots of what my jobs look like. Everything under "Notifications" is set correctly. Test emails and other system emails (SMART and login notifications) all work fine. I'm just not receiving scheduled job emails. Also, here is the output from: /etc/cron.d/openmediavault-userdefined


    Code
    SHELL=/bin/sh
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    # m h dom mon dow user    command
    0 0 * * 2 root /var/lib/openmediavault/cron.d/userdefined-3cd6b2ab-1606-4891-adbf-35c628f3486d | mail -E -s "Cron - Weekly Tuesday vm backups with encryption" -a "From: Cron Daemon <root>" root >/dev/null 2>&1
    0 0 * * 7 root /var/lib/openmediavault/cron.d/userdefined-07378671-31b9-4218-9413-4b0c985ae217 | mail -E -s "Cron - Weekly Sunday media backup with encryption" -a "From: Cron Daemon <root>" root >/dev/null 2>&1
    0 2 * * * root /var/lib/openmediavault/cron.d/userdefined-58256119-a577-46cd-aeff-3dafd24e81db | mail -E -s "Cron - Daily SnapRaid Bash Helper Script" -a "From: Cron Daemon <root>" root >/dev/null 2>&1
  • I've fixed the issue and it has nothing to do with OMV. It has to do with how rclone handles the output. Even though I am using rclone with verbose the output isnt getting sent to the mail command. I have to output the command to a log file then send the text of that file via mail. This is what I ended up doing:



    Bash
    #!/bin/bash
    /usr/sbin/rclone sync /export/vm-backups/ vm-backups: --log-file /var/log/rclone-sync-vms.log
    mail -s "Cron - Weekly Tuesday VM backups with encryption" -a "From: Cron Daemon <root>" root < /var/log/rclone-sync-vms.log
    rm /var/log/rclone-sync-vms.log

Jetzt mitmachen!

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