LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Disable daily ntpdate update mail (https://www.linuxquestions.org/questions/linux-newbie-8/disable-daily-ntpdate-update-mail-4175468980/)

carsonb 07-09-2013 05:21 AM

Disable daily ntpdate update mail
 
Because I've forgot to adjust my internal clock for daylight savingtime too often in the past, I've installed ntpdate and let it run daily by anacron. However, now I get this kind of email delivered every day:

Code:

Date: Tue,  9 Jul 2013 10:02:50 +0200 (CEST)
From: Anacron <root@********.net>
To: root@********.net
Subject: Anacron job 'cron.daily' on *****

/etc/cron.daily/ntpdate:
 9 Jul 10:02:50 ntpdate[14595]: adjust time server 213.239.154.12 offset -0.004679 sec

I'd like to only receive messages from cron if something has gone wrong, not a daily status update. I could change the anacrontab to deliver all messages to /dev/null, but then I'd get no warnings at all. Is there a way to control the granularity of anacron status updates ?
Thanks in advance!

AlucardZero 07-09-2013 07:34 AM

Assuming ntpdate writes to STDOUT not STDERR. in /etc/cron.daily/ntpdate, append the following to the line:

Code:

> /dev/null
Note the lack of a '2' .. errors will still be mailed.

michaelk 07-09-2013 07:56 AM

In most cases the preferred method would be to run ntp instead of ntpdate. ntp is a daemon so it isn't necessary to run a cron job. In addition it constantly updates both the system and hardware clocks and adjusts them for drift.

carsonb 07-09-2013 11:07 AM

Quote:

Originally Posted by michaelk (Post 4986920)
In most cases the preferred method would be to run ntp instead of ntpdate. ntp is a daemon so it isn't necessary to run a cron job. In addition it constantly updates both the system and hardware clocks and adjusts them for drift.

Well, yes, but I'm not in a dire need for perfect time synchronization; that would only increase the load on the ntp pool. :D

Quote:

Originally Posted by AlucardZero (Post 4986910)
Assuming ntpdate writes to STDOUT not STDERR. in /etc/cron.daily/ntpdate, append the following to the line:

Code:

> /dev/null
Note the lack of a '2' .. errors will still be mailed.

Thanks for the suggestion. I'll try that.


All times are GMT -5. The time now is 01:29 PM.