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.

February 27, 2010

Set date,time and timezone on dreambox (dm800)

Filed under: DreamBox — Tags: , , , , — admin @ 6:49 pm

You can set the time and date on dm800 by following command :

date -s YYYY.MM.DD-hh:mm:ss

YYYY is Year
MM is Month
DD is Day
hh is Hour (0-24)
mm is Minute
ss is Second

for changing the timezone , first get a file list of cities by following command :

ls /usr/share/zoneinfo/

choose your city or nearest city to you , then use the following command to change the timezone ( replace YOUR_CITY with your chosen city ) :

ln -sf /usr/share/zoneinfo/YOUR_CITY /etc/localtime

June 29, 2009

How to synchronize Linux Time Daily

Filed under: CentOS,Debian,General — Tags: , , , , — admin @ 6:51 pm

First you need to install rdate package.
For Debian :

apt-get install rdate

For CentOS :

yum install rdate

After installing the rdate package , install a new cron job to be run daily to synchronize your machine time and date.

crontab -e

and enter the following line into the cron file :

0 0 * * * /usr/bin/rdate -s time-nw.nist.gov && /sbin/hwclock --systohc

Powered by WordPress