Date in ubuntu

Posted: October 28, 2011 in Debian
Tags: , , , , , , , , ,

Selalu lupa….

1. Install ntp

root@webmail:~# aptitude install ntp

2. Get date from mst.sirim.my

ntpdate mst.sirim.my

3. Set script

root@webmail:~# pico /skrip/takwin

################ cut here ##################

#!/bin/bash
ntpdate mst.sirim.my

################ cut here ##################

4. Set Cron

root@webmail:~# crontab -u root -e

*/50 * * * * /skrip/takwin >/dev/null 2>&1

5. Run takwin

root@webmail:~# /skrip/takwin

28 Oct 19:52:27 ntpdate[1162]: step time server 202.190.26.30 offset 4.735816 sec

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s