Author Topic: Cron & Ntpdate/rdate  (Read 2874 times)

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Cron & Ntpdate/rdate
« on: December 31, 2005, 11:47:06 pm »
so if cron runs as root, I can have it run a ntpdate/rdate job. Theoretically

I have this
*/5 * * * * root /usr/bin/rdate -s 132.163.4.102
also tried
*/5 * * * * root /usr/bin/ntpdate 132.163.4.102

in my crontab, and it installs correctly, the /var/cron/log shows its running and what its running, so why isnt my date adjusting as it should? Any ideas, Its gotta be something small I am missing.
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

speculatrix

  • Administrator
  • Hero Member
  • *****
  • Posts: 3707
    • View Profile
Cron & Ntpdate/rdate
« Reply #1 on: January 01, 2006, 12:05:32 pm »
Quote
so if cron runs as root, I can have it run a ntpdate/rdate job. Theoretically

I have this
*/5 * * * * root /usr/bin/rdate -s 132.163.4.102
also tried
*/5 * * * * root /usr/bin/ntpdate 132.163.4.102

in my crontab, and it installs correctly, the /var/cron/log shows its running and what its running, so why isnt my date adjusting as it should? Any ideas, Its gotta be something small I am missing.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=109063\"][{POST_SNAPBACK}][/a][/div]

that isn't necessarily the right format for cron. try

*/5 * * * * /usr/bin/ntpdate 132.163.4.102 > /var/log/ntpdate.cron.log 2>&1

and see what you see in /var/log/ntpdate.cron.log when it runs.

might be worth writing a script to try "ping" before doing the ntpdate to verify the network is up.
Gemini 4G/Wi-Fi owner, formerly zaurus C3100 and 860 owner; also owner of an HTC Doubleshot, a Zaurus-like phone.