phpcrondaemonjob-schedulingdailybuilds

How To Set a Cron Script to Run Daily


I have a PHP file that I would like to run once per day. I know that in order to do this I need to set up a CRON job. From my understanding there should be a way to set-up the CRON job within my web host, but I do not know where this is located. Everything I see about the CRON job has to do with running it from my local computer. What is the missing link here? How do I format the filename? And any other pertinent information on how this is done would be greatly appreciated.


Solution

  • Can you login via SSH to your webserver? If so, type crontab -e and there you can edit your crontab file. You can run the script by typing php filename.php (mayber after installing php5-cli first).

    I don't know what kind of webserver you have. If you have no terminal access, then you have to look if your provider supports CRON Jobs (then he has to set it up), otherwise there is no possibility to do that.