Primal Habits
It is currently Thu Mar 30, 2017 8:25 am


Feed

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Nov 22, 2011 11:21 am 
Offline
User avatar

Joined: Sun Apr 25, 2010 1:02 pm
Posts: 115



How to Disable The Mail Alert By Crontab Command

How can I to disable the mail alert send by crontab? When my job is executed and the jobs cannot run normally it will send an email to root. Why do I receive e-mails to my root account from cron? How can I prevent this?

crontab command is use to maintain crontab files for individual users.

By default the output of a command or a script (if produced), will be emailed to your local email account. To stop receiving email output from crontab you will most likely need to append following string:

Cron Job Prevent the sending of errors and output

To prevent the sending of errors and output, add any one of the following at the end of the line for each cron job to redirect output to /dev/null.
Code:
Please Login or Register, to see this Content


Cron Job Example

Edit/Open your cron jobs, enter:
Code:
Please Login or Register, to see this Content


MAILTO variable

As pointed out by Anand Sharma, you can set MAILTO="" variable at the start of your crontab file. This will also disable email. Edit/Open your cron jobs
Code:
Please Login or Register, to see this Content

At the top of the file, enter:
Code:
Please Login or Register, to see this Content



.............................................

_________________
Check Out RouterHead8080 T.V.



Share on FacebookShare on TwitterShare on TuentiShare on SonicoShare on FriendFeedShare on OrkutShare on DiggShare on MySpaceShare on DeliciousShare on Technorati
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 7 hours [ DST ]


Related topics
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. Shell command for mysql attack

RouterHead8080

0

3811

Sun Apr 15, 2012 10:23 pm

RouterHead8080 View the latest post

There are no new unread posts for this topic. Crontab – Quick Reference

RouterHead8080

0

1952

Tue Nov 22, 2011 11:13 am

RouterHead8080 View the latest post

There are no new unread posts for this topic. How to edit and save crontab

RouterHead8080

0

5598

Tue Nov 22, 2011 11:24 am

RouterHead8080 View the latest post

There are no new unread posts for this topic. How to find nobody scripts sending mail WHM

RouterHead8080

0

1879

Thu Jul 28, 2011 8:17 pm

RouterHead8080 View the latest post

There are no new unread posts for this topic. How to locate nobody scripts sending mail WHM / Linux

RouterHead8080

0

1573

Fri Aug 19, 2011 12:51 am

RouterHead8080 View the latest post

 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron

Affiliates    Terms of use    Privacy policy   

Primal Habits, a Sceptersoft Company
Copyright © 2010 - 2017 Sceptersoft LLC. All rights reserved.