Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-05-23
4
Medium Priority
?
538 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 31

Accepted Solution

by:
serialband earned 600 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 600 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 800 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

WatchGuard Case Study: NCR

With business operations for thousands of customers largely depending on the internal systems they support, NCR can’t afford to waste time or money on security products that are anything less than exceptional. That’s why they chose WatchGuard.

Question has a verified solution.

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

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…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…
Suggested Courses
Course of the Month11 days, 12 hours left to enroll

916 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