Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
acbot
V2EX  ›  Linux

crontab 执行时间不正确

  •  
  •   acbot · Apr 6, 2022 · 2741 views
    This topic created in 1515 days ago, the information mentioned may be changed or developed.

    在 OpenWRT 和 Centos 两个系统中配置 crontab 任务如下

    00 8-23/5 * * * command (使用 curl 下载一个文件)

    以前在两个系统上定时任务都正常,最近不知道是什么原因 command (使用 curl 下载一个文件)执行后下载文件的时间不对了,OpneWRT 下载文件时间是 17 点,CentOS 下载文件在 18 点以前,而看 Centos 的 Cron 日志脚本执行的时间又是对的 18 点。不知道是什么原因

    Supplement 1  ·  Apr 9, 2022
    更正:此问题非 crontab 导致,而是使用 crontab 下载文件的这个软件更新后除了问题,它加载文件会修改这个文件的时间,真的是奇葩!
    4 replies    2022-04-07 09:16:23 +08:00
    Immortal
        1
    Immortal  
       Apr 6, 2022
    两个系统的系统时间一致么?
    acbot
        2
    acbot  
    OP
       Apr 6, 2022
    @Immortal 时间都是对的,另外这里不是说两个系统执行又时间差。而是本机在时间是正确的情况下,定时任务下载的文件时间不对。
    rekulas
        3
    rekulas  
       Apr 6, 2022
    stat filename
    对比文件访问时间创建时间呢
    acbot
        4
    acbot  
    OP
       Apr 7, 2022
    @Immortal
    @rekulas
    我还发现一个奇特的现象就是这个定时任务一天执行很多次,但目前我发现就 18 点这次文件的时间有问题。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2643 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 12:23 · PVG 20:23 · LAX 05:23 · JFK 08:23
    ♥ Do have faith in what you're doing.