Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 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...
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.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.