Cron Jobs

Cron Jobs is an application that allows you to schedule routine tasks to perform automatically within your website. Tasks such as deleting old files or forwarding a contact list can be automated to run on a schedule that you set up. You will need to have some coding knowledge in order to use Cron Jobs, but, if you (or a friend) know how to code in Linux, you can use Cron Jobs to easily set up and schedule tasks.

Watch the video tutorial or continue reading for written step-by-step instructions:

Cron Jobs is mainly used to modify your files and databases within your site. In order to use the Cron Jobs application on the dashboard, you first need to pick a command (a task) that you want to run and write the code for it. For example, if you have a contact form on your website, you can send yourself an updated list of all the submitted contact forms at the end of every week. Once you write the code (or program/script) that retrieves the contact forms from your website, you will need to upload that code to your site through the File Manager function. Once that piece of code is uploaded to your directory, you can then follow the instructions below to set up your cron job.

1. On your BYU Domains Dashboard, scroll down to the “Advanced” section near the bottom of the page and click on Cron Jobs.

2. You will be taken to a form where you can add a cron job. Make sure that your email is updated so that you can receive notifications when a cron job finishes running. 3. Select a time increment from the drop-down menu “Common Settings” in order to set how frequently the cron job will run. You can run a cron job daily, weekly, or even monthly. However, asks that the maximum number of times times you run a cron job is once every 15 minutes. 4. Type the file path in the “Command” field that corresponds to the file containing the code for your cron job (this file should already be uploaded to your website via FileManager). 5. Finally, click “Add New cron job” in order to finish the process.

Remember to watch your processes carefully the first few times they run to make sure they're running efficiently. If the cron job takes too long, you will want to optimize your script so that it doesn't require as many system resources. Setting a cron job to run too frequently, or running a cron job that doesn't have options declared correctly, can degrade server performance. For more information, you can read the cPanel directions for setting up cron jobs at https://documentation.cpanel.net/display/ALD/Cron+Jobs.