LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   crontab - fetchmail sends output to mail spool (https://www.linuxquestions.org/questions/slackware-14/crontab-fetchmail-sends-output-to-mail-spool-780315/)

mkoco 01-06-2010 11:20 AM

crontab - fetchmail sends output to mail spool
 
Hi all,
I'm new to mail via the CLI, so bear with me. I have this line in my crontab:
Code:

*/5 * * * * fetchmail
Which does check my mail every 5 minutes fine. But I get the command-line output mailed to me every 5 minutes as well. So I get a message in my mail spool every 5 minutes containing something like:
Code:

Fetchmail: no mail for me@there.who at pop.whatever.net
Fetchmail: 2 messages for metoo@nohere.themoon at pop.megadeuce.pillow
reading messages for metoo@nohere.themoon....

..etc

This doesn't happen when I run fetchmail by hand.

Any clue?

Nylex 01-06-2010 11:24 AM

cron sends output to you by default. I'm not sure whether you can change it, but the simple solution is just to redirect the output to /dev/null. This is what I do:

*/1 * * * * /usr/bin/fetchmail -K > /dev/null 2>&1

Woodsman 01-06-2010 03:39 PM

From the stock crontab for root:

"If you don't want the output of a cron job mailed to you, you have to direct any output to /dev/null."

:)

devnull10 01-06-2010 03:52 PM

Just for info, I set fetchmail up by create an rc.fetchmail file in /etc/rc.d and then linking to that in rc.local. It isn't recommended that you run as root however I found this to be the way I preferred to have it running. It allows me to stop, start and restart whenever I want just as you do with any other daemon.


All times are GMT -5. The time now is 06:54 PM.