Execute a Cronjob Every Minute Between Two Times

前端 未结 2 1900
名媛妹妹
名媛妹妹 2021-01-28 05:09

I need to run a bash script in crontab every minute between 8:45am and 9:50am of every day.

Code:

45,4         


        
相关标签:
2条回答
  • 2021-01-28 05:40

    http://www.nncron.ru/help/EN/working/cron-format.htm

    According to that website, you can do something like this:

    45-59 8 * * * /home/pull.sh > /home/logs/pull.log 2>&1
    

    I'm not certain what you're looking to do with this line:

    00/50 9 * * * /home/pull.sh > home/logs/pull.log 2>&1
    

    I actually don't know what that will do.

    0 讨论(0)
  • 2021-01-28 05:46

    Try this:

    45-59/1 8 * * * /home/pull.sh > /home/pull.log 2>&1
    00-50/1 9 * * * /home/pull.sh > /home/pull.log 2>&1
    
    0 讨论(0)
提交回复
热议问题