zoukankan      html  css  js  c++  java
  • centos同步时间

    1.查看时间

    [root@bogon ~]# date
    Thu Apr 4 11:24:24 CST 2019

    2.使用date -s修改时间

    [root@bogon ~]# date -s "2019/4/4 11:26" 
    Thu Apr  4 11:26:00 CST 2019

    3.修改时区

    使用新的时区文件覆盖系统默认时区
     # cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime                       

    4.安装ntpdate

    yum install ntpdate -y

    5.同步网络时间

    ntpdate ntp1.aliyun.com

    6.保存为bios时间

    同步BIOS时钟,强制将系统时间写入CMOS,使之永久生效,避免系统重启后恢复成原时间。
    # clock -w

    7.设置crontab同步时间

    59 23 * * *    ntpdate ntp1.aliyun.com
    *  *  *  *  *  command 
    分 时 日 月 周 命令 
    第1列表示分钟1~59 每分钟用*或者 */1表示 
    第2列表示小时1~23(0表示0点) 
    第3列表示日期1~31 
    第4列表示月份1~12 
    第5列标识号星期0~6(0表示星期天) 
    第6列要运行的命令 

    8.查看bios时间

    [root@bogon ~]# hwclock  -r
    Thu 04 Apr 2019 11:35:20 AM CST  -0.365289 seconds
  • 相关阅读:
    枚举代码(待更新)
    数据类型
    char
    opencv中读写视频
    数据获取与存储
    Mat 与 IplImage 和 CvMat 的转换
    Mat类的输出格式
    Mat 类的内存管理
    Mat_类
    Mat表达式
  • 原文地址:https://www.cnblogs.com/hanRR/p/10653932.html
Copyright © 2011-2022 走看看