shutup cron.hourly mail reports
I recently put a script in there and now cron spams me every hour with reports I don't want and I don't need (it's simply setting time against a server so I notice as soon as it's off ). I went into /etc/crontab and deleted the --report from the line for cron.hourly. This didn't stop it though.
Now I found this site http://www.unixgeeks.org/security/ne...ix/cron-1.html saying: Quote:
Thanks for the help! |
When putting it into the /etc/cron.hourly directory as a script, you might want to set the output of you command to /dev/null:
Code:
#!/bin/sh You add the >> /dev/null right after the command you have put in the crontab ie. if you added 30 * * * * /path/to/script >> /dev/null it would run the script every hour on *.30hrs and the output is sent to /dev/null |
I directly put this into the directory:
Quote:
Quote:
|
You are correct with your second statement... That should do the trick...
You could also do something else, that in case an error occurs you will get a message.. then your command would be: Code:
#! /bin/sh Since stderr (2) was defined before stdout (1) was, it will actually go to stdout and not to /dev/null If this is too confusing, just use: Code:
#! /bin/sh |
I have a bit of programming experience though I wouldn't have come up with that myself I get the idea :)
It worked great for my script. Apparently there's something else spitting errors. O well searching for that thing now. Thanks for the help! |
All times are GMT -5. The time now is 12:00 PM. |