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.

  • Chris

    I’m a novice at this Linux type stuff. I have been looking for a way to sync my Dreambox (DM800) to Internet time for ages…..this is the only bit of info that I have been able to locate so far! Please could you make it easier for me to understand what to do…..it is with the “Web Server” part and also “PHP installed on it”. these bits I do not understand. I have a Windows XP PC running which my DM800 is hooked up to via shared folder for my Movie streaming. can i use this PC as the server for the DM800 and is it easy to set up the PC side of things?

    “Change IP_OR_FQDN to your own hosting IP and domain name.” – My PC IP is 168.192.2.3 and my user name is HP_Administrator. is this the info required for the hosting IP and Domain Name?

    Thanx for helping me understand more.

  • FiFtHeLeMeNt

    I understand it may seem complicated for beginners , by web server you need a webhosting account somewhere. a free webhosting which supports php will work too. it has nothing to do with IP address of your PC.

  • Some time the date and time automatically missing for the dreambox so this sync is very useful to the generate the time and date on the Dreanbox..So thanks for the nice stuff…

  •  That peace of code was exatcly what i am searching for. Thank you.

  • stefos

    working great.
    thanks for the tip

Powered by WordPress