suppress mail sent by batch or at command in linux

i have several batch or at jobs being scheduled every 3 minutes. Is it possible to suppress the mail being sent to the user who initially starts the job? I don't need to know anything about the job.

The user issues command:
  batch_the_command now + 3 minutes
LVL 1
penguins_ruleAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BigDeerCommented:
You should be able to add a  >/dev/null 2>&1 to the end of the command to prevent it from sending an email
0
penguins_ruleAuthor Commented:
it still created the mail
it did not show the job-id of the original command
0
BigDeerCommented:
if this is a crontab job you have to edit the job in the crontab via crontab -e. Otherwise, I'm not sure how this job runs or is scripted. It may be hard coded into the script.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

penguins_ruleAuthor Commented:
$ cat batch_the_command
#!/bin/bash
echo "This is the list of things to do for minute"

The command and response:
$ at -f /home/penguin/batch_the_command now
job 2174 at 2014-08-11 16:46

You have new mail
$ mail
& t
Message  1:
From penguin@localhost  Mon Aug 11 16:46:12 2014
Return-Path: <penguin@localhost>
X-Original-To: penguin
Delivered-To: penguin@localhost
Subject: Output from your job     2174
To: penguin@localhost
Date: Mon, 11 Aug 2014 16:46:12 -0400 (EDT)
From: penguin@localhost (penguins_rule)
Status: R

This is the list of things to do for minute

Open in new window

0
penguins_ruleAuthor Commented:
How would I set it up in cron to run every three minutes and no email?
0
Gerwin Jansen, EE MVETopic Advisor Commented:
Modify the at command line like this:

$ at -M -f /home/penguin/batch_the_command now
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gerwin Jansen, EE MVETopic Advisor Commented:
Some more details about at:

gerwin@ubuntu:~$ at -?
at: invalid option -- '?'
Usage: at [-V] [-q x] [-f file] [-mMlbv] timespec ...
       at [-V] [-q x] [-f file] [-mMlbv] -t time
       at -c job ...
       atq [-V] [-q x]
       at [ -rd ] job ...
       atrm [-V] job ...
       batch

Note the -M option

From man at:

       If a job is submitted to a queue designated with an  uppercase  letter,
       the  job is treated as if it were submitted to batch at the time of the
       job.  Once the time is reached, the batch processing rules with respect
       to  load average apply.  If atq is given a specific queue, it will only
       show jobs pending in that queue.

       -m      Send mail to the user when the job has completed even if  there
               was no output.

       -M      Never send mail to the user.

       -f file Reads the job from file rather than standard input.

       -t time run the job at time, given in the format [[CC]YY]MMDDhhmm[.ss]
0
penguins_ruleAuthor Commented:
thank you for the man page on at command. I did not realize RedHat Linux and ubuntu had different switches. The -M switch did not show on my man page, but it still works.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.