Design - Cron Jobs
Help setting up cron jobs .
Cron jobs (cron tasks) are available on the Advanced and Reseller Hosting Plans only.
Cron is a useful tool to automate website, script and behind-the-scenes processes. To access your cron tools login to your Control Panel and click the 'cron' icon.
When running a script via cron, it is recommended that you use the following syntax in the command ...
Perl / CGI Scripts
perl /home/username/public_html/path/to/script.cgi
PHP Scripts
/usr/local/bin/php -q /home/username/public_html/path/to/script.php
In the above commands, make sure you substitute the specific information with your own account details (username, path to script).
Cron is most often used to run a script at set times however, it has other uses ...
Replace a file
cp -f /home/username/public_html/newfile.html /home/username/public_html/oldfile.html
This command will replace the 'oldfile.html' with the 'newfile.html'. Often used for demo sites to renew site pages or areas where users have accessed and changed information.
No reports
> /dev/null
Add this at the end of your cron command to NOT receive any emailed reports after the cron runs.
|