So, you have a webpage that runs a script which you need to automate? Command line and contab to the rescue!
Wget, the linux command line tool can “get” PHP pages and execute them, displaying the contents in an output file. This makes it incredibly useful for managing automated jobs inside content management systems. It’s really simple to use:
wget -q -O output.log "http://example.com/example_script.php"
wget simply runs setting the output to a logfile with the request at your webpage’s script as a full URL. Quotes around the URL are highly recommended. You can tell if the script has finished by looking at output.log and making sure the closing HTML tag is there.
It’s really easy to add this to a crontab for automation. Simply edit your crontab from the terminal interface (crontab -e) and add the line as you require:
0 6 * * * wget -q -O output.log "http://example.com/example_script.php"
This runs the wget command at 6am every day.