Setting up a scheduled task on a server can be quite frightening and scary even. That is if you don’t know the steps to go by. It can be quite tiring to have to remember to run a task on your server on a daily basis. Especially if you can just schedule the task and it will run itself on a regular basis. I’m sure you’re wondering how to go about this, well, Cron is the way to go.

Cron is a service created to execute scheduled commands and tasks. It allows you to run a task or a command at times set by for the job. For example, maybe your computer’s disk space is easy clogged up by temporary files. And you need to make sure to delete them every week so your disk space is not being used up. You can schedule this task with cron job and cron job will carry out scheduled tasks for you when the time comes. Even better, it send you an email everytime it performs the task you scheduled. So if you are interested in how to set up a cron job, then this article will take you step by step through the process.

Step by Step Process on How to Set up a Cron job

  1. To begin with, you need to log in to your cPanel web hosting account. If you don’t have one then you need to create one.
  2. Under the advanced section provided, you will see a ‘cron jobs’ icon, click right on it.
  3. Next, you need to make sure your email address provided is valid. Cron job will be sending you updates on tasks or commands carried out. If the email address is not a valid one, then enter a valid email address and click on the ‘update email’ button provided.
  4. Next, you need to set the frequency which you would like your cron job to be carried out. You can do this by using the drop-down box located by each setting. This includes minutes, hours, days, weekdays and months settings. You can also set the frequency by clicking the ‘common setting’ box so you can choose from a list of predefined frequently used intervals. This list rage from every minute to monthly, weekly and even once a year.
  5. Once you’ve set the frequency you will prefer, then add the command or task you would like to set and then click the ‘add new cron job’ button to complete the setting

Once this is done, then you have successfully created a cron job. Which will execute a certain task or command on the desired days or time you would prefer. Note that you can edit a cron job or even remove it completely when you feel you no longer need it. So that the task will not continue running as scheduled by logging in to your cPanel web hosting account once again. Visiting the advanced section, then clicking once again on the cron job icon. Next you scroll to the last section which is titled ‘current cron jobs’. Find the cron job you would like to edit or remove. You would be provided with options to either edit or remove under action.

Also read on how to setup Cloudflare

Final Thought

If you followed the step by step process listed above, then you can relax and let the cron job do your biddings for you efficiently. While informing you through an email of every successful task carried out. If this article was helpful in educating you on how to set up a cron job or you have questions generally, then reach out to us in the comment session provided below.