Here is my content of sudo crontab -e
@hourly /home/userName/ntpdate.sh
The content of my script (ntpdate.sh) //.25 is my ntp server
echo "Current time is $(date), " >> /home/userName/ntpdateLog.txt
ntpdate -u 192.168.1.25 >> /home/userName/ntpdateLog.txt
When I simply run the command by itself, or run the script by itself, it works fine and outputs to the file. The script has correct permissions to run.
The error I'm getting in /var/log/syslog is this:
CRON[6386]: (root) MAIL (mailed 1 byte of output; but got status 0x004b, #012)
postfix/sendmail[6410]: fatal: open /etc/postfix/main.cf: No such file or directory
Why is there a mail error when the script doesn't need mail (that I know of).
I know that ntpdate is deprecated, but it is the only thing that does what I need right now (assuming I can get cron to run it).
ntpd
and forget aboutntpdate
.