Admins eHow SysAdmin Tips & Tricks

March 5, 2010

How to sync dreambox date and time automatically

Filed under: DreamBox — Tags: , , , — admin @ 9:37 am

I could not find rdate or ntpclient packages for dreambox , so I came up with another solution to sync my dreambox date and time when it boots up.
First you need another server with synced date and time , so we can read the correct date and time from it. also we need a webserver and php installed on it.
Create a script named “dreambox-date.php” on root folder of your web server with following content :

<?php
date_default_timezone_set("UTC");
echo date("Y.m.d-G:i:s");
?>

Create another file named “03datesync” in “/etc/network/if-up.d” folder of your dreambox with following content :

#!/bin/sh
date -u -s `wget -O - http://IP_OR_FQDN/dreambox-date.php`

Change IP_OR_FQDN to your own hosting IP and domain name.
Also make it executable :

chmod +x 03datesync

All done 🙂 Now when dreambox boots up and its network interface is up , the above script would be called and it syncs your dreambox date and time.

Powered by WordPress