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 一致
相关文章
相关标签/搜索