Cron Jobs can be a great way to manage your website more efficiently. They allow you to have scheduled tasks completed on a more standardised time schedule without the need for manual input from you or another user of your team.
What is a Cron Job?
A cron job is a Linux command. It is used on websites to scheduling commands and tasks that need to be completed at sometime in the future. It is often used for repeatable tasks that should be completed every day by the owners of the website, but managing that process would be time consuming and inefficient. For example, resetting a countdown timer or a guest counter could be done through a cron job. Or it could be used to send out notifications.
There are some scripts within Drupal and WHMCS that require the website owner to use cron job to complete certain actions.
There are three components within most cron jobs. The script that has to be completed, the command that will execute the script on a repeat and the action or output of that script. When using cron jobs there is often a lot support and most scripts that require one will provide you the with necessary instructions on what needs to be established.
How to Create a Cron Job
Here are the instructions on how you can create a Cron Job.
Step 1 – Log In
The first step is to log into your Cloudways Platform dashboard using your credentials.
Step 2 – Applications
Next click on the ‘Applications’ option that is in the top menu and select the website/application that you would like to add a cron job for.
Step 3 – Add New Cron Job
Within the application, there will be an option that reads, ‘Cron Job Management’. Enter this section and then click on the ‘Add New Cron Job’ button that is clearly visible.
Step 4 – Configure Cron Job
Now you can decide how often you would like to run the new cron job. There is a dropdown menu that has some predefined options you. Or you can create your own time period if you would like to.
Then set the type of script that you will running within the task (PHP, curl or wget). You will then need to set the command that is to be executed. When you’ve made the changes, you can click on the ‘Submit’ to save the cron job settings.
Your cron job will now be listed under the Basic tab.
If you’re looking to make changes to your cron jobs, edit their function or to remove them, then you will need to go to this tab to make the changes.
Final Word: How to Create a Cron Job
Cron jobs are an effective tool in website management. They allow you to save time and energy by giving the server commands to complete tasks on a schedule that don’t really need human interaction. Their creation and management on Cloudways is really simple.
However, it is important to note that only account owners or those team members with full privileges can edit cron jobs.