![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| awk related query | abhisek.says | UNIX for Dummies Questions & Answers | 2 | 05-22-2008 02:49 AM |
| Query related to scp command | sureshg_sampat | Shell Programming and Scripting | 2 | 12-03-2007 05:59 AM |
| sed related query | gopsman | Shell Programming and Scripting | 1 | 11-30-2007 09:03 AM |
| Query related to for i in `cat $TEMP_DIR/country.txt | sureshg_sampat | Shell Programming and Scripting | 1 | 08-31-2007 07:58 AM |
| Query related to #!/bin/sh | sureshg_sampat | Shell Programming and Scripting | 2 | 02-08-2007 05:54 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Date change related query
Good day folks,
This is my first post on this board and I thank you in advance for helping me with this issue. Any idea how I can synchronize server time with another timeserver but have my server lag behind by 2 seconds? Meaning...I need a simple unix script that I can run as crone that takes as variable the url of another server and makes my server's time that of the other server plus 2 seconds. So if it is there 9:00 pm, my server's time becomes 21:00:02 All help is appreciated Thanks Frank |
|
|||||
|
If you're using GNU date, you can use the --date option:
Code:
my_time=$(date --date="2 seconds") This is not really the best way of doing this, though, in case the script takes longer, or the time gets changed a different amount. The more time you take trying to fix up a two second delay, the more likely you'll be off by more than two seconds in the end... |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|