how to run a php script daily with the cron job on Ubuntu os

前端 未结 4 920
情话喂你
情话喂你 2021-01-14 08:50

command to runI am using ubuntu 12 and lamp server . I want to run a php script after every 1 hour . i have create a crontab to execute this and if i check my cron list with

4条回答
  •  忘掉有多难
    2021-01-14 09:33

    This is the description of crontab arguments

    # Minute   Hour   Day of Month       Month          Day of Week        Command    
    # (0-59)  (0-23)     (1-31)    (1-12 or Jan-Dec)  (0-6 or Sun-Sat)                
    0        2          12             *                *            /usr/bin/find
    

    To Run your script every hour use below crontab entry.

    0 */1 * * * /usr/bin/php5 -q /var/www/cronjobs/cron1.php
    

    This way your script will start executing every hour.

提交回复
热议问题