You can use cPanel's Cron Job feature to run Unix commands and also automate the execution of your PHP, Perl, or Python Scripts. To create a Cron Job, first log into your cPanel and select "Cron jobs:"

cron1

Add a New Cron Job

Cron jobs use the following time field sequence:

[minute] [hour] [day] [month] [weekday] [command]

48 09 * * * /my/script -v

This will run every morning at 9:48 AM. The * is a wild card, meaning "every day/month, etc" For example; 48 09 * * * = every 48 minutes of every 9th hour of every day of of the month.  Just to clarify, the setting for "Weekday" should be interpreted as day of the week, including Saturday and Sunday. Many people think of weekday as just Monday through Friday, but when referring to cron job settings, it actually means every day of the week.



IMPORTANT:

It is suggested that Cron Jobs not be scheduled at the top or bottom of the hour. Remember that you are not the only user on the server who may be using a cron job. If all the cron jobs were scheduled at the same time, the server performance would be slowed when it tries to execute all of the scripts. So, for example, the best times to set a cron job to run may be at an odd minute such as the example above. It is set to run at 9:48 every morning.  Help keep server performance at an optimum level by setting the cron job execution at an odd time.





Specify the command to run the php script

The command should have two parts:

[program to run (perl/pyth./php)] [switches] [script]

The program to run will specify the type of script you are executing, and will either be:

  • php 
  • python
  • perl

The script will need to be connected directly to its location on our server, so it will be something similar to: /home/username/public_html/path/to/script, with "username" being your username.

  • To run a PHP script: php -q /home/username/public_html/scripts/testrun.php
  • For Python scripts: python /home/username/public_html/path/to/script
  • For Perl/CGI scripts: /home/username/public_html/cgi-bin/yourscript.pl

Alternative to wget command

Most scripts that are run through wget can be ran through lynx or curl commands, which are allowed in Cron Jobs. Be sure to set the user agent in any lynx or curl commands you run. If the user agent isn't set, mod_security rules on the server will prevent the commands from running. For example:

curl -A -s useragent (URL)

curl -A "Mozilla 4.0" http://mydomain.com/myscript.php

lynx -dump -useragent (URL)

Did you find this article helpful?
breadb5 2013-02-25 9:10 pm
Hi Christi

All worked for me, but I used the eshop module that seems not to allow access to make any changes in names to use SEO rules.
Example:
http://www.breadboard-adapters.com/eshop.php?category=29&view=productListPage

Perhaps I miss some control?
breadb5 2013-02-25 9:10 pm
Hi Christi

All worked for me, but I used the eshop module that seems not to allow access to make any changes in names to use SEO rules.
Example:
http://www.breadboard-adapters.com/eshop.php?category=29&view=productListPage

Perhaps I miss some control?
Unfortunately, the builder does not have a setting to create SEO friendly urls. You can only edit the pagename.
Unfortunately, the builder does not have a setting to create SEO friendly urls. You can only edit the pagename.

Login to comment.

Your Opinion Matters

... but we need to know what you're thinking!

The Community Support team wrote the article you're looking at now. We like to think it's perfect, but we're sure you have some suggestions. Please, let us know what they are!

Feedback
Your Email Address
Because we'd like to talk with you!

Support Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.