Running Shell Scripts With Crontab *
Crontab allows you to clock and run your own Unix shell scripts automatically. It is available only in Unix-based plans and requires the knowledge of Unix shell commands.
To enable crontab jobs, do the following:
- Login to your H-Sphere control panel
- Select FTP/User Account
- Select FTP Manager
- Enable Crontab if disabled
- Agree with charges, if any.
- Click the Edit icon for Crontab.
- On the page that appears, add the crontab job:
Commands are executed by cron when the minute, hour, day and month fields match the current time, and when at least one of the two day fields (day of month, or day of week) match the current time. If you want to set any minute, hour, day, enter * symbol.
In the Command box write a command to be executed by cron, i.e. path relative to your root home directory.
The Mail-To address is where the system will direct reports if errors occur.
To delete a job, check the box in the Delete section and click Submit Query.
to Run PHP you need to include the path of php in your command line - example
depending on the PHP version you require
replace PHP5 with the correct version
example - if your using php55:
If you do not wish emails with the output of the script make sure the script outputs to the bin:
/your-script.php > /dev/null
if you also want the errors supressed:
/your-script.php > /dev/null 2>&1
Normally cron will email you the output. If the output is send to the bin, there will be no email as cron has nothing to report!
For setting up timing, see:
* Unix only
If you have any further questions, please submit a support ticket - at www.OccSupport.com