Email: bknpk@hotmail.com Phone: +972-54-7649119
V

 

ASIC/FPGA Design and Verification Out Source Services

Updating System Time from the WEB

If your PC time is not accurate or you simply want once at time get the exact time from the WEB, this script might help.

  1. First find a WEB site from which you want to take the time updates. A few considerations in selecting the WEB site: accurate, few text to process by the following PERL script.
  2. Second use the following script to update by getting the time from the site and adjust to your location time zone. Script
  3. Another script, which does the same, follows. It simply has the Israeli local time with no need to change anything in time read from the HTML page. Script 1

  4. Another, much simpler, way do it on a debian box, is using ntpdate-debian command.
    First install the package:apt-get install ntpdate
    Next, as root user, fire the command:ntpdate-debian

    One can consider, using cron with a daily update:
    1. Create a crontab file with the following line:
      0 0 * * * /etc/init.d/init_ntpdate.unx >>/dev/null 2>&1

    2. Where /etc/init.d/init_ntpdate.unx script contains the following commands:
      #! /bin/sh

      #0 0 * * * /etc/init.d/init_ntpdate.unx >>/dev/null 2>&1
      #* * * * * command to be executed
      #min (0 - 59)
      #  hour (0 - 23)
      #    day of month (1 - 31)
      #      month (1 - 12)
      #        day of week (0 - 6) (0 is Sunday, or use names)

      date +%y%m%d_%H%M%S >> /var/log/pini_init_ntpdate.txt
      ntpdate-debian >> /var/log/pini_init_ntpdate.txt

    3. You might also be interested in the following script from crontab.

Contact me now at:

  ...


I would be happy to offer my services. Call ASAP !


Home

Download Area






Search This Site


Feedback This Site




new pages on this site