crontab执行时间和系统时间不一致

注意: crontab执行时间与用date命令显示出时间不一致, 很有可以能是没有重启服务导致的.

  1. 查看系统时间
    vagrant@homestead:~$ timedatectl status
                          Local time: Fri 2019-06-28 09:48:56 CST #本地时间
                      Universal time: Fri 2019-06-28 01:48:56 UTC 
                            RTC time: Fri 2019-06-28 01:48:57     #硬件时间
                           Time zone: Asia/Shanghai (CST, +0800)
           System clock synchronized: yes
    systemd-timesyncd.service active: yes
                     RTC in local TZ: no
  2. 删除和修改时区
    rm /etc/localtime && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  3. * 重启服务
    service crond restart
  4. 测试crontab执行时间是否与Local time 一致
posted @ 2019-06-30 10:01  不鸣则已,一鸣弱鸡  阅读(1242)  评论(0编辑  收藏  举报