V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
mopig
V2EX  ›  Linux

Crontab 设置的运行时间是 10点,为什么总是在 23 点执行?

  •  
  •   mopig ·
    mopig · 2014-01-20 15:02:30 +08:00 · 5204 次点击
    这是一个创建于 3750 天前的主题,其中的信息可能已经有所发展或是发生改变。
    以上时间都是执行机器上的 CST 时间。
    6 条回复    1970-01-01 08:00:00 +08:00
    oldcai
        1
    oldcai  
       2014-01-20 15:11:47 +08:00
    机器上执行命令date看看时间是不是对的
    mopig
        2
    mopig  
    OP
       2014-01-20 15:19:12 +08:00
    @oldcai

    Cron:0 10 * * *
    查看文件的更新时间: Jan 19 23:00
    date(当前的时间):
    Mon Jan 20 15:18:55 CST 2014
    oldcai
        3
    oldcai  
       2014-01-20 15:39:55 +08:00   ❤️ 1
    sudo bash -c "echo TZ="UTC" >> /etc/default/cron"
    sudo /etc/init.d/cron restart
    oldcai
        5
    oldcai  
       2014-01-20 15:42:39 +08:00   ❤️ 1
    忘了,你应该是要TZ='Asia/Shanghai'
    mopig
        6
    mopig  
    OP
       2014-01-20 16:20:18 +08:00
    根据 @oldcai 的方法,已成功解决
    @feuvan 3Q

    感谢已发送。。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2710 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 15:27 · PVG 23:27 · LAX 08:27 · JFK 11:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.