SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2010-05-18 22:42:53

realgpp
Member
Registered: 2010-05-18
Posts: 12

System Time Syncronization Through Shell

I didn't find anything about it in the forum.
No packages installation needed!

So, only to print date

rdate -p time-a.timefreq.bldrdoc.gov

to set date

sudo rdate time-a.timefreq.bldrdoc.gov

I've put this alias in my ~/.bashrc because of frequent use.

alias time_adjust='sudo rdate time-a.timefreq.bldrdoc.gov'

List of servers here.

I hope this will helpful. smile

Last edited by realgpp (2010-05-18 22:57:51)

Offline

Be excellent to each other!

#2 2010-05-19 08:01:29

corenominal
WRONG
From: Lincoln, UK
Registered: 2008-11-20
Posts: 5,037
Website

Re: System Time Syncronization Through Shell

Nice tip, thank you for sharing. smile

There is also the Network Time Protocol daemon and utility programs, which can be installed to perform similar. From memory, I think the following should get you up and running:

sudo apt-get install ntp

Offline

#3 2010-05-19 11:44:40

slapfish
#! Die Hard
From: Athens, Greece
Registered: 2009-10-22
Posts: 601

Re: System Time Syncronization Through Shell

very nice...I was searching for something like that for a while...

is there a way to be executed on startup but without the need of sudo (in autostart.sh)???

I know this can be done with ntp but I prefer just a command over a daemon...

Offline

#4 2010-05-19 13:48:43

Tunafish
#! Die Hard
From: the Netherlands
Registered: 2010-03-07
Posts: 1,204

Re: System Time Syncronization Through Shell

You can add an exception to you sudoers file

sudo gedit /etc/sudoers

at the end add:
<username> ALL= NOPASSWD: <path-to-rdate>/rdate

I've been told to be carefull with the sudoers file, but this seems to work quit well.

best,
tuna


sed 's/stress/relaxation/g'
Privacy & Security on #!

Offline

#5 2010-05-19 13:53:54

slapfish
#! Die Hard
From: Athens, Greece
Registered: 2009-10-22
Posts: 601

Re: System Time Syncronization Through Shell

Another great new thing!!! thanks Tunafish...

Offline

#6 2010-05-19 19:38:01

Tunafish
#! Die Hard
From: the Netherlands
Registered: 2010-03-07
Posts: 1,204

Re: System Time Syncronization Through Shell

You're welcome!


sed 's/stress/relaxation/g'
Privacy & Security on #!

Offline

#7 2010-05-19 21:14:18

realgpp
Member
Registered: 2010-05-18
Posts: 12

Re: System Time Syncronization Through Shell

slapfish wrote:

is there a way to be executed on startup but without the need of sudo (in autostart.sh)???

about autostart.sh... i've seen right now that there is this code in the file

rdate -s ntp2.inrim.it 

-s set the date without printing it.
I tried this from the shell and it works fine, so I'm wondering why sometimes the time goes 1/2 hours in the future?

Offline

#8 2010-05-20 07:58:38

Tunafish
#! Die Hard
From: the Netherlands
Registered: 2010-03-07
Posts: 1,204

Re: System Time Syncronization Through Shell

@realgpp: Thanks for sharing

Another list of nist servers (also europe)
http://www.dataman.ro/sntp/time-servers/


btw... ntp (as mentioned by corenominal) works fine as well...


sed 's/stress/relaxation/g'
Privacy & Security on #!

Offline

#9 2010-05-21 11:05:38

realgpp
Member
Registered: 2010-05-18
Posts: 12

Re: System Time Syncronization Through Shell

@tunafish thanks for european nist servers!

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo