解决crontab执行时间与系统时间不一致的问题
展开
    本次RedHat版本为:Red Hat Enterprise Linux Server release 7.4 (Maipo)。

    在crontab中添加了如下定时任务:

 

    但是发现该任务实际执行的时间依次为16:00,17:00,18:00,19:00,比实际晚了8个小时,经查发现crontab所在时区为世界时:

 

    解决办法:将世界时改为需要的时区,我这里是需要改成英国伦敦时区。如下

ln -s /usr/share/zoneinfo/Europe/London /etc/localtime /etc/localtime
service crond restart

相关文章:

  • 1970-01-01
  • 2022-12-23
  • 2022-01-24
  • 2021-11-14
  • 2022-12-23
  • 2021-11-17
  • 2021-12-19
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-15
  • 2022-12-23
  • 2022-01-07
相关资源
相似解决方案