在我的Ubuntu10.04框(用户,而不是根用户)上可以发出
sudo net time set
而且效果很好。
我更希望这个盒子更有规律地获得净时间,或者至少每次登录时都是这样。因此,我尝试添加设置为/etc/profile的净时间。那就失败了。我加了几节看起来像
user ALL=(ALL) NOPASSWD: /usr/bin/net
to /etc/sudoers (使用visudo)。帮不上忙。
我从来没有碰过cron,所以我不知道如何添加chron选项卡。(依赖系统时间重置系统时间似乎有点矛盾。)
做这件事最好的方法是什么?
如果这是个cron工作,我想举个简单的例子。
同样的问
我对Linux Shell脚本编程非常陌生,不知道是否有人可以帮助我完成以下工作。
我创建了一个脚本来与我的linux机器同步时间,但似乎只有一个exec命令完成
#!/bin/bash
#Director SMS Synch Time Script
echo The current date and time is:
date
echo
echo Synching GTS Cluster 1 directors with SMS.
echo
echo Changing date and time for director-1-1-A
exec ssh root@128.221.252.3
ntpdate -u -u地址工作正常,但ntpd不更新时间。请提出原因。
[root@commander_a ~]# ntpdate -d 10.120.8.32
13 Jan 01:14:46 ntpdate[6172]: ntpdate 4.2.6p3@1.2290 Fri Aug 28 07:43:22 UTC 2015 (1)
Looking for host 10.120.8.32 and service ntp
host found : 10.120.8.32
transmit(10.120.8.32)
receive(10.120.8.32)
transmit(10.120.8
这是一个XenServer 7.1 CU1主机。NTP的行为应该与任何其他Linux distro一样。我们已经为/etc/ntp.conf配置了以下服务器(尝试了具有类似结果的其他服务器,并且这些服务器在另一个环境中工作:
server 0.north-america.pool.ntp.org
server 1.north-america.pool.ntp.org
server 2.north-america.pool.ntp.org
server 3.north-america.pool.ntp.org
重新启动服务后,我们检查统计数据:
[root@c0101 ~]# ntpq -p
我有一个Centos5.8Linux服务器。我正在经历一个有点奇怪的问题,并发现这是一些与系统时间。当我检查日期命令时,输出是非常奇怪的。下面是一个例子:
[root@web ~]# date
Thu Feb 19 21:21:59 JST 2015
[root@web ~]# date
Thu Feb 19 21:23:43 JST 2015
[root@web ~]# date
Thu Feb 19 21:22:02 JST 2015
[root@web ~]# date
Thu Feb 19 21:23:45 JST 2015
[root@web ~]#
如您所见,每个日期命令输出不同的