Results 1 to 3 of 3

Thread: Getting an email from every job

  1. #1
    Join Date
    Feb 2008
    Beans
    3
    Distro
    Ubuntu 10.04 Lucid Lynx

    Getting an email from every job

    On my home server running 12.10, I have a few things I want to set up email notifications for, mainly backups.

    However, when I set up an smtp server, xmail or ssmtp, etc, I get an email for every job that the server does!

    In crontab, I even suffix the jobs with
    Code:
    >> /dev/null
    to push output to /dev/null, to no avail

    I still get the full description of the job with >> /dev/null at the end

    Is there some other notification system I could use? Or can I tell ssmtp to only be used by certain programs? I only want to know if a backup from backintime fails, that is all

    Thanks all
    Last edited by Doles284; July 4th, 2013 at 03:21 AM.

  2. #2
    Join Date
    Jan 2005
    Location
    Illinois USA
    Beans
    1,048

    Re: Getting an email from every job

    It should be

    Code:
    &> /dev/null
    If you still get emails than it isn't cron sending you emails.
    CloudRck.com - Host on CloudRck
    I sponsor open source projects and support users of such technologies. PM for details

  3. #3
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: Getting an email from every job

    You can alternatively turn off emails globally in crontab, then use

    Code:
    1 2 3 4 * some_command 2>&1 | mail -s 'Running Backup' you@example.com
    The "2>&1" ensures that any messages sent to syserr also get mailed to you.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •