This is a quick step-by-step guide to viewing, adding and removing crons via the 34SP.com Control Panel.
- How to view your crons
- How to add a new cron
- How to delete a cron
- How to setup email notification
- Example Crons
Please Note: We recommend you only make alterations to the cron page if you have prior experience setting up crons.
How to view your crons
Login to your account
Firstly, you'll need to login into your 34SP.com account at http://account.34sp.com.
Choose 'Manage Sites'
Once you have logged in, click on the 'Manage Sites' icon.
This will bring up a list of websites or domain names you have in your 34SP.com account. Simply choose the website you wish to edit by clicking on it.
After you have clicked on the website you wish to edit, you will be presented with your website overview page. Choose 'Advanced' from the product navigation.
Choose 'Manage Crons'
Then click on the icon labelled 'Manage Crons'.
Managing your crons
The 'Manage Crons' page provides an overview of your scheduled tasks, with each cron listed in a table. Along with viewing each cron you can also remove them via the table, by clicking on the relevant icon.
How to add a new cron
Add new cron
If you wish to add a new cron, simply click on the button labelled 'Add New Cron' when viewing the 'Manage Crons' page.
Enter cron time
This will bring up a form. Simply fill in the form with the time intervals that you wish your cron to run.
You can use * in any time field to ignore that field. You can also use a / to indicate a repeating pattern, .e.g., */2 in the 'Minute' field would indicate 'every two minutes'.
Enter cron command
Then copy & paste your command into the text box labelled 'Command'. Be sure to use the full path to any programs and refer to the examples at the end of this page if you get stuck.
When you're done, click 'Create New Cron' to save your changes.
You'll then be returned to the 'Manage Crons' page, were your new cron will be listed in the table.
How to delete a cron
Remove a cron
If you wish to delete a existing cron simply click on the 'Remove' button (the 'trash' icon) for the cron you wish to remove, when viewing the 'Manage Crons' page. This will remove the cron permanently.
How to setup email notification
Choose 'E-mail Notification'
When viewing the 'Manage Crons' page, just click on the tab labelled 'E-mail Notification'.
Enter an email address
This will bring up a form. Simply fill in the form with an email address of your choice. When you're done, click 'Save Settings' to save your changes.
The output of all your cron tasks will now be emailed to the email address you specified.
Run a PHP script every hour
To run a PHP script once every you should set the 'Minute' field to 0, this means it will run on the hour. You could set the field to 30 to run the cron at 30 minutes past every hour. The other time/date fields should be set to *, to indicate that those fields are ignored.
The command field should contain the path to PHP then the path to the script file to be run.
Access a web page every 10 minutes
To access a web page every 10 minutes you should set the 'Minute' field to */10. The other time/date fields should be set to *, to indicate that those fields are ignored.
The command field should contain the path to Curl then the URL of the web page to be accessed.
Backup a database every Sunday at 2am
To backup a database every Sunday at 2am you should set the 'Day of week' field to 0, as days are referenced numerically, beginning with Sunday. To run the cron on Wednesday you would use 3. The 'minute' field should be set to 0, to indicate 0 minutes past the hour, and the hour should be set to 2, for 2am. The other time/date fields should be set to *, to indicate that those fields are ignored.
The command field should contain the path to mysqldump, followed by the database access details and finally a redirection to the backup file.
/usr/bin/mysqldump -u mydatabaseuser -pmydatabasepassword mydatabasename > mybackupfile.sql