Cron is the Linux equivalent of Window's Task Scheduler.
Jobs are executed from
/etc/crontab1. Create a PHP script file.
2. Edit the crontab
# crontab –eThis is the file syntax:
minutes hours day_of_month month day_of_week commandwhere:
minutes: 0-59
hours: 0-23
day_of_month: 1-31
month: 1-12
weekday: 0-6
command: Any shell command or web document
Wildcard: * (Allow any value)
I will use
wget because PHP files need to be parsed by Apache, we need to execute it via
wget command using the URL to the page. To check if your box has wget:
# wget --helpTo run the script every Wednesday morning at 9:30 AM, the cronjob file will contain the following in single line:
30 9 * * 3 wget http://www.domain.com/file.phpSave the file and add to crontab
# crontab samplecronjob