Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Correct server call?

  1. #1
    Join Date
    Feb 2014
    Beans
    6

    Correct server call?

    So a user on my machine would have to run to configure the date on the machine:
    Code:
    rdate X.X.X.X
    How could I check (with bash) if the server called with rdate command was the right server (X.X.X.X), if the time on the machine was synced with the right server.


    Thanks.

  2. #2
    Join Date
    Sep 2010
    Beans
    898

    Re: Correct server call?

    Why not set up a task to do the time synchronization automatically?

    Actually, Ubuntu, by default, sets up ntpdate to do that.

  3. #3
    Join Date
    Feb 2014
    Beans
    6

    Re: Correct server call?

    The problem is not in time sync. rdate is being used for that, and I need to verify if it's being synced with the correct server.

  4. #4
    Join Date
    Feb 2014
    Beans
    6

    Re: Correct server call?

    bump, please

  5. #5
    Join Date
    Feb 2008
    Location
    Funky Town, AUS
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: Correct server call?

    Thread moved to Server Platforms.

    It is forum etiquette to wait 24 hours before bumping. Please adhere to this. Thanks.

  6. #6
    Join Date
    Aug 2009
    Location
    Charleston, SC (USA)
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Correct server call?

    Welcome to the forums Heb_Boozad

    ntpdate supercedes rdate. I'm not sure how you would list out very verbose server information. The rdate utility is very basic and doesn't have a lot of functionality. Perhaps this would get you in the right direction?

    Code:
    rdate -p -l <IPADDRESS>
    I would highly recommend using ntpdate as it is more commonly used and has a more robust feature set.

    Time Protocol

    Hope that helps!
    ~Caboose
    Last edited by Caboose885; February 14th, 2014 at 04:41 PM.
    "When our actions do not, our fears do make us traitors." -- Shakespeare
    "Unless someone like you cares a whole awful lot, nothing is going to get better. It's not!" -- Dr. Seuss
    "No man has ever seen his dreams fulfilled and regretted the sacrifice necessary to fulfill them" -- Mattie Montgomery


  7. #7
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,050
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Correct server call?

    With ntpd(part of the ntp metapackage), you can specify multiple time servers. So your time base will be the average of those servers. If there is a large discrepancy between times, you will get a system log entry. You can run ntp on each client's machine. It is a low-overhead service.

    I don't understand the OP's question. The user would normally not have to run rdate because ntpd sets the time automatically and keeps it to within microseconds of a national time standard with corrections every hour.

    ntpdate, which is installed by default in Linux systems will set the correct time once on boot. This may be good enough, but if you don't reboot for several weeks, then you can experience drift. I'm not sure if ntpdate is called after resume-from-suspend to check for the correct time.
    Last edited by tgalati4; February 14th, 2014 at 04:40 PM.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  8. #8
    Join Date
    Feb 2014
    Beans
    6

    Re: Correct server call?

    I'm aware that ntpd is superior to rdate. But my assignment is to check if the machine used the right server with rdate. So if I know that rdate was used, and know the correct server (e.g. X.X.X.X), how could I check if the rdate command used had the right server (X.X.X.X) used as argument.

  9. #9
    Join Date
    Aug 2009
    Location
    Charleston, SC (USA)
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Correct server call?

    Check your cron jobs or wherever you have setup the rdate command to run. If it has the right IP then everything should be working just fine.
    "When our actions do not, our fears do make us traitors." -- Shakespeare
    "Unless someone like you cares a whole awful lot, nothing is going to get better. It's not!" -- Dr. Seuss
    "No man has ever seen his dreams fulfilled and regretted the sacrifice necessary to fulfill them" -- Mattie Montgomery


  10. #10
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,050
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Correct server call?

    This sounds like a homework assignment where the issue is not the time but rather write a script to check that a correct parameter was passed. With rdate, I presume that a time correction is logged somewhere (/var/log/rdate or syslog). So after the command is run, have the script grep the log file and pull out the time server IP address. Then compare that IP address to a grep of the user's history file to compare IP addresses to see if they are the same.

    Again, I'm not sure what the lesson here is, but I would be filling out my drop card.

    Code:
    grep time /var/log/syslog
    This gives me:

    Feb 14 15:42:27 Mint14-Extensa ntpdate[9186]: adjust time server 67.212.118.201 offset -0.050166 sec
    Last edited by tgalati4; February 15th, 2014 at 09:10 AM.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •