解决crontab执行时间与系统时间不一致的问题

解决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

猜你喜欢

转载自www.cnblogs.com/showker/p/12660167.html