Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Someone asked me to update the times on 4 servers that are not connected to the internet and they have no ntp server.


/etc/hosts     jollibee     mcdonalds     burgerking     chowking 

The easiest thing for me to do would be to run

date -s "25 Jul 2012 14:40:00"

for each of the 4 servers.

I know they will want me to do this again in the future and I find it a pain to set the time manually. What i want to do is set the time on one box and then set the times on the other boxes off this box.

e.g. if i set jollibee's time to the correct date i would then run

[root@mcdonalds /]# date -s `ssh jollibee 'date +"%d %b %Y %T"'`

and so on for my other servers

Thing is I'm getting:

date: too many non-option arguments: 2012 ...
Try `date --help' for more information.

Can anyone tell me what I'm doing wrong here?

share|improve this question
up vote 1 down vote accepted

The best solution is to setup NTP servers on all the four servers with each other configured as upstreams (but no upstreams on the Internet). You probably want to give one of the servers a higher stratum so that the others all tend to synchronise to that one.

Another option is to setup rdate. Configure one of the servers to run a Time Protocol server (typically done with inetd), and setup a cronjob on the other servers to run rdate regularly against the time server.

share|improve this answer
If it was up to me i would set that up but unfortunately it will take time to do that. – rumz Jul 25 '12 at 7:04

I am not sure whether this is a good way to set the date/time of your server or not, but you need to modify your command by enclosing the ssh command within quotes such as:

date -s "`ssh jollibee 'date +"%d %b %Y %T"'`"
share|improve this answer
Thanks i didn't know it was that simple! – rumz Jul 25 '12 at 7:03
It is only for this one instance, for other servers we have NTP setup. – rumz Jul 25 '12 at 7:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.