Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]Disabling cron mails every time a user run a command
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
cibonato
Apprentice
Apprentice


Joined: 25 Apr 2006
Posts: 200
Location: Macross City

PostPosted: Mon May 29, 2006 10:47 pm    Post subject: [SOLVED]Disabling cron mails every time a user run a command Reply with quote

Ladies and genttlemen, I created a crontab file for a specific user and everything is goind fine (so?!?!?!).

The problem is that everytime the command is executed the user recieve a mail, but the command is executed once a minute. Yes, it means 3600 mails a day and also means problems to me... hehehe.

So, does anyone know a way to cancel the mailing from cron?

Thank you thank you.
_________________
64 Bits, good good!


Last edited by cibonato on Tue May 30, 2006 9:50 pm; edited 1 time in total
Back to top
View user's profile Send private message
Katphish
Apprentice
Apprentice


Joined: 05 Dec 2005
Posts: 155

PostPosted: Tue May 30, 2006 1:32 am    Post subject: Reply with quote

what are you using? vixie-cron?

redirect standard out from the command to /dev/null:

Code:
01 * * * * /your/command >/dev/null


You can send standard error there too but I personally like to know when a command does not go as planned.
Back to top
View user's profile Send private message
cibonato
Apprentice
Apprentice


Joined: 25 Apr 2006
Posts: 200
Location: Macross City

PostPosted: Tue May 30, 2006 3:23 pm    Post subject: Reply with quote

Will this redirection stop mailing from cron?

Yes, I´m using vixie-cron.

Thank you.
_________________
64 Bits, good good!
Back to top
View user's profile Send private message
cibonato
Apprentice
Apprentice


Joined: 25 Apr 2006
Posts: 200
Location: Macross City

PostPosted: Tue May 30, 2006 9:53 pm    Post subject: Reply with quote

Ok... it's solved. I found something that do exactly what I want: I just have to put MAILTO="" in the user's crontab and done. No more mails everytime the command is executed.

Great.
_________________
64 Bits, good good!
Back to top
View user's profile Send private message
Katphish
Apprentice
Apprentice


Joined: 05 Dec 2005
Posts: 155

PostPosted: Wed May 31, 2006 7:08 am    Post subject: Reply with quote

cibonato wrote:
Will this redirection stop mailing from cron?


Yeah, that is exactly what it will do if the emails are the standard output of your program.

You can use a null mailto, but you would be throwing the baby out with the bath water.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum