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

前端 未结 4 911
情话喂你
情话喂你 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条回答
  •  猫巷女王i
    2021-01-14 09:37

    Make Script File /etc/scripts/cron.sh with contain

    cd /var/www/
    
    /usr/bin/php cron.php
    

    Save it then

    chmod +x cron.sh
    

    then go on /etc/crontab

    15 15 * * * root /etc/scripts/cron.sh
    

    save it and wait

提交回复
热议问题