Solved

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

Posted on 2013-05-23
4
518 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 27

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 13

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

757 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

17 Experts available now in Live!

Get 1:1 Help Now