LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-03-2001, 08:44 AM   #1
mikeyt_333
Member
 
Registered: Jun 2001
Location: Up in the clouds
Distribution: Fedora et al.
Posts: 353

Rep: Reputation: 30
Shutting up Crond


I have certain items that are configured in my crontab to run every 15 minutes, 2 hours, and other times also, but I don't want to know everytime they run. How do I shutup cron, I get over 1 mb of email of just cron messages, always the exact same thing, it is rather annoying, and I have yet to find a way to handle this. Any ideas are greatly appreciated!

Thanks in Advance
Mike.
 
Old 12-03-2001, 09:19 AM   #2
rshaw
Senior Member
 
Registered: Apr 2001
Location: Perry, Iowa
Distribution: Mepis , Debian
Posts: 2,692

Rep: Reputation: 45
edit your crontab file, change the mailto line to: mailto=/dev/null or mailto=""
 
Old 12-03-2001, 09:23 AM   #3
mikeyt_333
Member
 
Registered: Jun 2001
Location: Up in the clouds
Distribution: Fedora et al.
Posts: 353

Original Poster
Rep: Reputation: 30
Thanks for such a quick response! I have done that and it works for preventing the emails from going to root, but each individual user also has access to cron and I use it as a different user, it seems that cron defaults to emailing the user of that cron job each time it is run. So for example in my crontab at one time it said MAILTO=root, I removed the root and that stopped messages going to root, but lets say I then have user Bob using cron and he doesn't want to get messages from cron how would I go about disabling that...

Thanks!
 
Old 12-03-2001, 09:49 AM   #4
rshaw
Senior Member
 
Registered: Apr 2001
Location: Perry, Iowa
Distribution: Mepis , Debian
Posts: 2,692

Rep: Reputation: 45
if i remember correctly, user crons are in /var/spool/cron/<username>.
logged in as a user, type crontab -l to list the contents, or crontab -e to edit. or hand edit as root.
 
Old 12-03-2001, 09:54 AM   #5
mikeyt_333
Member
 
Registered: Jun 2001
Location: Up in the clouds
Distribution: Fedora et al.
Posts: 353

Original Poster
Rep: Reputation: 30
These files are just a copy of the cronjobs for those users, they don't contain a MAILTO= directive.
:smash:
 
Old 12-03-2001, 10:25 AM   #6
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Rep: Reputation: 64
Just a thought, but does anything else use the files in these directories, or even the directories themselves? If not, then you could sym-link /var/spool/cron --> /dev/null. It's a bit of a sledge-hammer idea, but it would mean that if you created a new user you wouldn't have to edit your crontab and remove the mail bit, cron would automatically send everything to oblivion.
 
Old 12-03-2001, 10:31 AM   #7
mikeyt_333
Member
 
Registered: Jun 2001
Location: Up in the clouds
Distribution: Fedora et al.
Posts: 353

Original Poster
Rep: Reputation: 30
I'm not sure if I understand you correctly. /var/spool/cron is the directory that contains the schedule files, if I sym-link it to /dev/null I will lose my schedule files and my cron jobs.
 
Old 12-03-2001, 10:36 AM   #8
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Rep: Reputation: 64
Oh yeah. Sorry buddy - forgot. Not at my Linux box at the mo, and normally I don't use cron for much. No, but the actual mail files (/var/spool/cron/username/mail) you could. Again, it is definitely a sledgehammer regime, but then it'd probably be easier to edit the crontab and do this (a-la rshaw's method) anyway.
 
Old 12-03-2001, 10:42 AM   #9
mikeyt_333
Member
 
Registered: Jun 2001
Location: Up in the clouds
Distribution: Fedora et al.
Posts: 353

Original Poster
Rep: Reputation: 30
I would like to do it al a rshaws method but there is no way to tell it not to mail other users, that is what I am saying. In my main crontab file there is a MAILTO= directive, but in individual cron files, there is no such directive, so I can't simply tell it not to mail. Also, /var/spool/cron/[username] are files not diretories.
 
Old 12-03-2001, 12:46 PM   #10
rshaw
Senior Member
 
Registered: Apr 2001
Location: Perry, Iowa
Distribution: Mepis , Debian
Posts: 2,692

Rep: Reputation: 45
i don't think the mailto line is there by default, the way it is in the system crontab. do a crontab -e, and add mailto="" then save. or after each line you don't want mail from, you can enter >> /dev/null or >> /whatever/file/you /want/the/results/saved/in. use a single > to completely over-write the file each time or a double >> to add the new results at the end of the file.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with crond and auditd pfaendtner Linux - Software 4 04-25-2005 10:41 AM
crond problem branden_burger Linux - General 3 03-25-2005 05:03 PM
crond doesn't like mpeg2enc ? discShredder Linux - Software 0 04-06-2004 09:47 AM
crond timeouts ? startail Linux - Software 0 01-11-2004 04:27 AM
Crond jimval7 Linux - General 2 03-06-2002 11:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration