View previous topic :: View next topic |
Author |
Message |
cibonato Apprentice
Joined: 25 Apr 2006 Posts: 200 Location: Macross City
|
Posted: Mon May 29, 2006 10:47 pm Post subject: [SOLVED]Disabling cron mails every time a user run a command |
|
|
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 |
|
|
Katphish Apprentice
Joined: 05 Dec 2005 Posts: 155
|
Posted: Tue May 30, 2006 1:32 am Post subject: |
|
|
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 |
|
|
cibonato Apprentice
Joined: 25 Apr 2006 Posts: 200 Location: Macross City
|
Posted: Tue May 30, 2006 3:23 pm Post subject: |
|
|
Will this redirection stop mailing from cron?
Yes, I´m using vixie-cron.
Thank you. _________________ 64 Bits, good good! |
|
Back to top |
|
|
cibonato Apprentice
Joined: 25 Apr 2006 Posts: 200 Location: Macross City
|
Posted: Tue May 30, 2006 9:53 pm Post subject: |
|
|
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 |
|
|
Katphish Apprentice
Joined: 05 Dec 2005 Posts: 155
|
Posted: Wed May 31, 2006 7:08 am Post subject: |
|
|
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 |
|
|
|