Solved

Linux commands....have I done it correctly?

Posted on 2013-05-23
4
519 Views
Last Modified: 2013-05-25
Hi guys,

I've been following the commands below on the command line:

https://kb.swivelsecure.com/wiki/index.php/NTP_servers

I'd like to know when it gets to the section where it says :

'add the following line to the file timesync.sh

ntpdate -t 2 -s NTP_SERVER_IP > /dev/null 2>& 1'

Whehter it means I must type 'ntpdate -t 2 -s NTP_SERVER_IP > /dev/null 2>& 1' in the CLI? Or does it mean I must open the file timesync.sh and add 'ntpdate -t 2 -s NTP_SERVER_IP > /dev/null 2>& 1' into that file, save it, close it and resume with the rest of the commands on the CLI?

Thanks for your help
Yash
0
Comment
Question by:Yashy
4 Comments
 
LVL 28

Accepted Solution

by:
serialband earned 150 total points
ID: 39191778
Yes, it means to put that text in the file so that cron will automatically synchronize the date daily.  You need to run the rest of the commands on the command line to set the correct file permissions for cron to work correctly.  You also run the ntpdate command once to manually synchronize the time to the ntp server.
0
 
LVL 33

Assisted Solution

by:Dave Howe
Dave Howe earned 150 total points
ID: 39193612
The latter. Note that the NTP_SERVER_IP there is a place marker - you should replace it with a NTP server IP, taken ideally from your internal lan (so the clock is in sync with your other hosts for logging consistency)
0
 
LVL 14

Assisted Solution

by:frankhelk
frankhelk earned 200 total points
ID: 39194204
Prefacing my real issues on that, I delare that serialband and DaveHowe are right as far as answering your specific question.

I'd like to add that the method described at the link is a very rude way of synchronizing the time and is in some way an abuse of the NTP software.

At first, the ntpdate command is deprecated for some years now, the effect could be accomplished with the NTP client daemon executable now. See the NTP doc at http://www.ntp.org.
Second, with the described procedure the system is allowed to float around without any corrective action for 24 hours, then it is drawn to the correct time with an as hard as possible step - if there is no glitch in the single sync attempt that allows the system to float around for another 24 hours ... or more. The attempt will fail anyhow if the NTP daemon ntpd is already active on your system due to blocked ports - even if misconfigured.

If you'd like to have a reliable time sync of the system I'd recommend to use the NTP daemon in the way it is intended to be used. Try YAST to configure the NTP daemon correctly.

The NTP daemon uses a much smarter way to sync the time on your system with an NTP server. Instead of performing hard steps every now and then, it permanently adjusts the frequency settings of the local clock to keep it running with the same speed as the server's clock. That allows time synchronity permanently within a range of some milliseconds (!). It might perform hard steps of the the clock only at system boot (only once, and only if needed) and in very rare circumstances. And it allows to sync with several time servers for redundancy - it keeps complex statistics while checking the servers times and syncs to the most stable one. If conditions change (network load, response times,  server availability, etc.) it changes the source server as needed to provide a maximum stability of the local clock.
Last but not least, there's software around that is delicate with occuring time steps on the system. These little divas produce unpredictable results if the time is not properly synced among the respective group of systems (Believe me, I know what I'm talking about on that issue)
If you use YAST and need no special tricks, setting up NTP is a very easy task.
0
 
LVL 1

Author Comment

by:Yashy
ID: 39196835
thank you for your help guys on this.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now