linux修改时间

时间:2021-09-01 11:13:12

1、修改linux系统时间

[root@localhost ~]# date -s "2016-10-15 13:15:12"

2、将系统时间和网络服务器时间同步

[root@localhost ~]# ntpdate asia.pool.ntp.org

附: 网络时间服务器

微软公司授时主机(美国)
time.windows.com

台警大授时中心(*)--推荐使用
asia.pool.ntp.org

中科院授时中心(西安)--尝试没连上
210.72.145.44

网通授时中心(北京)
219.158.14.130

3、将硬件时间和系统时间同步

[root@localhost ~]# /sbin/hwclock --systohc

4、定时执行命令

*  *  *  *  *  command to be executed
第一个*表示分钟,第二个*表示小时,第三个*表示一个月的那一天,第四个*表示月份,第五个*表示一周的那一天。其中要表示任何一个都可以就直接用*表示。前面五个位置以后就表示要执行的命令和参数