Go Back   Singapore Web Hosting Talk > LEARNING CENTER > Server Administration

Server Administration General dedicated servers administration topics.

Reply
 
Thread Tools
Old 04-09-2003, 23:17   #1
royong
SGWHT Administrators
 
royong's Avatar
 
Join Date: 01-07-2002
Location: Singapore
Posts: 1,469
royong is a splendid one to beholdroyong is a splendid one to beholdroyong is a splendid one to beholdroyong is a splendid one to beholdroyong is a splendid one to beholdroyong is a splendid one to beholdroyong is a splendid one to beholdroyong is a splendid one to behold
HOWTO : Synchronize With Time Server Daily At 0700 Hours

Log into the server via SSH
As ROOT carry out the following :-

# cd /etc
# vi /etc/crontab
##########################################
Add the following line to the end of the file:
00 7 * * * root rdate -s time.nist.gov
01 7 * * * /sbin/hwclock --systohc
##########################################
Save and Exit
:wq
##########################################
__________________
Roy Ong
Site Admin - Singapore Web Hosting Talk - My PM facility has been disabled. Please contact me via email instead.
My Web | My Tweets | My LinkedIn

Last edited by royong; 09-10-2003 at 21:00.
royong is offline   Reply With Quote

Old 09-10-2003, 19:15   #2
choon
SGWHT Senior Member
 
Join Date: 01-07-2002
Location: Singapore
Posts: 488
choon has a spectacular aura aboutchoon has a spectacular aura about
Hi Roy,

I will assume this is for Red Hat Linux server right? If so, you need to add in:

1. Check whether rdate package is installed or not:
rpm -qa|grep rdate
If not install, no point continue.

2. I believe you are only updating your system clock/time. What about your hardware clock/time? /sbin/hwclock --systohc

Just my thoughts

Thanks.
__________________
Giam Teck Choon
System Administrator
Join my community today at choon.NET Community to share server related tips and tricks!
External/One-Year WHM/cPanel licenses | Linux/FreeBSD Server Management | Xen VPS Solutions (with/without WHM/cPanel or DirectAdmin)
choon is offline   Reply With Quote
Old 09-10-2003, 20:59   #3
royong
SGWHT Administrators
 
royong's Avatar
 
Join Date: 01-07-2002
Location: Singapore
Posts: 1,469
royong is a splendid one to beholdroyong is a splendid one to beholdroyong is a splendid one to beholdroyong is a splendid one to beholdroyong is a splendid one to beholdroyong is a splendid one to beholdroyong is a splendid one to beholdroyong is a splendid one to behold
In all honesty, yes .. you should sync your system time and your hardware time.

I'll update the HOWTO

In addition, a NTP could also work but that would only add another daemon into the list. Not really necessary in my case since its not really mission critical to have times on the EXACT dot.
__________________
Roy Ong
Site Admin - Singapore Web Hosting Talk - My PM facility has been disabled. Please contact me via email instead.
My Web | My Tweets | My LinkedIn
royong is offline   Reply With Quote
Old 09-10-2003, 21:36   #4
choon
SGWHT Senior Member
 
Join Date: 01-07-2002
Location: Singapore
Posts: 488
choon has a spectacular aura aboutchoon has a spectacular aura about
If you are going to update time/clock, must well update both hardware and system time/clock right

I have similiar HOW TO at my forum though

Thanks.
__________________
Giam Teck Choon
System Administrator
Join my community today at choon.NET Community to share server related tips and tricks!
External/One-Year WHM/cPanel licenses | Linux/FreeBSD Server Management | Xen VPS Solutions (with/without WHM/cPanel or DirectAdmin)
choon is offline   Reply With Quote
Old 16-10-2003, 10:10   #5
choon
SGWHT Senior Member
 
Join Date: 01-07-2002
Location: Singapore
Posts: 488
choon has a spectacular aura aboutchoon has a spectacular aura about
This is another way of doing it for Red Hat Linux but you can't set on when to update your system & hardware clock/time though.

Step 1: Gain root access via SSH to your server.

Step 2: Check whether rdate is installed.
Code:
rpm -qa | grep rdate
If rdate is not install, please install it before continue.

Step 3: Create a shell script, chmod it to executable and place it into /etc/cron.daily directory with the below content.
Code:
#!/bin/sh
rdate -s time.nist.gov
/sbin/hwclock --systohc
For me, I create /etc/cron.daily/rdate file directly using the following command.
Code:
echo '#!/bin/sh' > /etc/cron.daily/rdate
echo "" >> /etc/cron.daily/rdate
echo "rdate -s time.nist.gov" >> /etc/cron.daily/rdate
echo "/sbin/hwclock --systohc" >> /etc/cron.daily/rdate
chmod +x /etc/cron.daily/rdate
Hope this helps ;)
__________________
Giam Teck Choon
System Administrator
Join my community today at choon.NET Community to share server related tips and tricks!
External/One-Year WHM/cPanel licenses | Linux/FreeBSD Server Management | Xen VPS Solutions (with/without WHM/cPanel or DirectAdmin)
choon is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump




All times are GMT +8. The time now is 11:55.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright (C) 2002-2015 Brought to you by Singapore Web Hosting Talk (SGWHT). All Rights Reserved.