Solved

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

Posted on 2013-05-23
4
530 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 29

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

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 …
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

752 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