582033
V2EX  ›  问与答

crontab 每分钟的写法

  •  
  •   582033 · Oct 23, 2013 · 5626 views
    This topic created in 4772 days ago, the information mentioned may be changed or developed.
    难道不是 */1 * * * * 么
    7 replies  •  1970-01-01 08:00:00 +08:00
    Livid
    Livid
    MOD
    PRO
    Oct 23, 2013 via iPhone
    1
    * * * * * command
    582033
    582033
    OP
    Oct 23, 2013
    2
    原来是因为crontab无法直接执行bashrc中的环境变量...
    Choutreeman
    Choutreeman
    Oct 23, 2013 via Android
    3
    @582033 command要写绝对路径
    kfll
    kfll
    Oct 23, 2013 via iPhone
    4
    man 5 crontab
    pubby
    pubby
    Oct 23, 2013
    5
    写法没错的

    个人碰到过crontab唯一坑的地方是
    day of month 和 day of week都指定的话,是任意一个满足就会执行,而不是两个都满足才执行。

    Note: The day of a command's execution can be specified by two fields —
    day of month, and day of week. If both fields are restricted (ie, are
    not *), the command will be run when either field matches the current
    time. For example, ``30 4 1,15 * 5'' would cause a command to be run at
    4:30 am on the 1st and 15th of each month, plus every Friday.
    wzxjohn
    wzxjohn
    Oct 23, 2013
    6
    */1 * * * *
    和
    * * * * *
    均可
    awanabe
    awanabe
    Oct 24, 2013
    7
    楼主运行crontab的时候最好把log输出到一个文件中....用于调试和记录--
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1399 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 16:50 · PVG 00:50 · LAX 08:50 · JFK 11:50
    ♥ Do have faith in what you're doing.