Solved

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

Posted on 2013-05-23
4
533 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 30

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-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

632 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