As I have recently acquired an Internet connection I have been playing around with time synchronisation. There are a few tools on the oztivo image that deal with this (ntpdate/rtimetz), but they have a few shortcomings (especially for those of us that do not use the emulator) so I have put together an rdate implementation.
Note: This is likely to only be of use to a very select few... If you have a working setup that you are happy with, then there is little need to read any further...
This program supports a “set time” option as well as being friendly to DOS CR's that are sometimes found within peoples /etc/postcodezones file It will use the TZ/TZDIR environment variables (if defined) rather than performing database lookups.
There are many ways of executing it. By adding an ‘–s’ it will set both the hardware (CMOS) and the software (O/S) time on the TiVo. If the '-s' option is not used, then it will output the time in a format that is suitable for use by settime (to remain compatable with rtimetz).
Example 1
The following will lookup the postalcode in the database and then lookup your timezone in the /etc/postcodezones file and using that information attempt to find the timezone information by looking in /var/hack/zoneinfo.
Code:
# rdate –v 129.6.15.28 132.163.4.101 128.138.140.44
# rdate –vs 129.6.15.28 132.163.4.101 128.138.140.44
Example 2
The following does not require the /etc/postcodezones file as we have specified which timezone to use, it will look in TZDIR for the information files (TZDIR defaults to /var/hack/zoneinfo).
Code:
# TZ=Pacific/Auckland rdate –v 129.6.15.28 132.163.4.101
# TZ=Pacific/Auckland rdate –vs 129.6.15.28 132.163.4.101
Example 3
The following tells the application the exact location of the zoneinfo file (take note of the the colon ':'), thus allowing you to place the zoneinfo file where-ever you wish.
Code:
# TZ=:/var/hack/zoneinfo/Pacific/Auckland rdate –v 129.6.15.28
# TZ=:/var/hack/zoneinfo/Pacific/Auckland rdate –vs 129.6.15.28
QUICK INSTALLATION FOR NEW ZEALAND USERS
Code:
1. Make the rdate program executable
# chmod 755 rdate
2. Move it into the /var/hack/bin directory
# mv rdate /var/hack/bin
3. Create a directory to hold the "Auckland" zoneinfo file
# mkdir -p /var/hack/zoneinfo/Pacific
4. Move the provided "Auckland" zoneinfo file into this directory
# mv Auckland /var/hack/zoneinfo/Pacific
5. Run the command and check that things look okay
# TZ=Pacific/Auckland rdate –v 129.6.15.28
6. Run the command with the "set" (-s) option to change the date/time
# TZ=Pacific/Auckland rdate –vs 129.6.15.28
Bookmarks