Rdate

To get around the problems of manually setting the date on every system, a utility named rdate can be used. This will set the local system time to that of a specified remote machine. For example, to set helium to the same date as hydrogen we would run:

helium# rdate hydrogen
Sun October 22 17:30:00 GMT 2002
hydrogen#

To automate this procedure, we could nominate a machine to be our “time server.” As explained above, we have chosen hydrogen for this task. First, we set the correct time on hydrogen. Next, we run rdate on a regular basis, by adding an entry to the root crontab. The redirection will ensure that we don't receive the output as mail every time cron runs:

 helium# crontab -l | grep rdate 0 4,12,20 * * * rdate timeserver > /dev/null ...

Get Solaris™ Operating Environment Boot Camp now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.