How to run a cronjob every X minutes?

前端 未结 6 1069
走了就别回头了
走了就别回头了 2020-11-30 23:40

I\'m running a PHP script in a cronjob and I want to send emails every 5 minutes

My current (crontab) cronjob:

10 * * * * /usr/bin/php /mydomain.in/c         


        
6条回答
  •  旧巷少年郎
    2020-12-01 00:08

    # .---------------- minute (0 - 59)
    # |  .------------- hour (0 - 23)
    # |  |  .---------- day of month (1 - 31)
    # |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
    # |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
    # |  |  |  |  |
    # *  *  *  *  * user-name  command to be executed
    

    To set for x minutes we need to set x minutes in the 1st argument and then the path of your script

    For 15 mins

    */15 * * * *  /usr/bin/php /mydomain.in/cromail.php > /dev/null 2>&1
    

提交回复
热议问题