sntp cron job

ok so i want to schedule a cron job to keep my server in the correct time. i run the following command from a command prompt and it works.
sntp -v -P no -r nist.time.nosc.us > /home/tester/time.log 2>&1 and get the followign output to me log file
sntp options: a=2 v=1 e=0.100 E=5.000 P=2147483647.000
d=15 c=5 x=0 op=1 l=/etc/sntp.pid f= nist.time.nosc.us
sntp: time changed by 2.751 secs to 2013 May 17 08:52:48.049 +/- 0.010+0.037

I then run schedule a cron job by opening up a cron tab by using crontab -u root -e and enter the following
30 19 * * * sntp -v -P no -r nist.time.nosc.us > /home/tester/time.log 2>&1
When i do that i get the following

/bin/sh: sntp: command not found

So what am i doing wrong?

Hi khill1963,

/bin/sh: sntp: command not found

So what am i doing wrong?

cron jobs run with a very limited set of environment variables… including PATH. How about explicitly adding the path to the binary to the command?

30 19 * * * /usr/sbin/sntp -v -P no -r nist.time.nosc.us > /home/tester/time.log 2>&1

As a side note… while it will work as long as the time drift isn’t too bad, running a time update command via a time-based service sounds strange (I’ve done it, too :D). How about simply setting up ntpd to do the job?

Regards,
Jens