Cron Jobs

Cron Jobs

Cron jobs allow you to automate certain commands or scripts on your server to complete repetitive tasks automatically. A cron job allows you to run a certain command at times set by the job. For example, you could set a cron job to delete temporary files every week so that your disk space is not being used up by those files.

 

Warning! It is important that you familiarize yourself with how cron jobs work. You need to have a good knowledge of Linux commands before you can use cron jobs effectively, especially when using the "Advanced (Unix Style)." Check your script with your hosting administrator before adding a cron job.

 

cPanel includes two ways to create cron jobs for your web hosting account:

 

  • Standard - GUI based for beginners or users who are not familiar with Linux commands.

  • Advanced (Unix Style) - Command line style of creating cron jobs. You should have experience creating cron jobs on the command line before using this feature.

 

Before you get started, please view the following web pages to learn more about Cron Jobs:

 

http://en.wikipedia.org/wiki/Cron (Basic)

http://www.unixgeeks.org/security/newbie/unix/cron-1.html (Advanced)

 

Using The Standard GUI

 

1. Click on the "Standard" button.

 

2. The first option request that you enter the email address where you want the output of your cron job files to be sent. Enter the email address in the text box provided.

 

3. By default, "Entry 1" will be available to you. The first option is "Command to run." Enter the command or path to a script/file you want to run in the text box.

 

4. Below the "Command to run" are five options for setting the time and frequency your cron job will run:

 

  • Minute(s)

  • Hours(s)

  • Days(s)

  • Month(s)

  • Weekday(s)

 

Select from each of the categories accordingly.

 

5. Next, click on the "Save Crontab" to create the cron job entry. Or if you want to reset the modifications you have made back to the default settings, click on the "Reset Changes" button.

 

6. A confirmation page will be shown stating "Cron Updated!" Click on the "Go Back" button to return to the main Cron Job screen.

 

Using the Advanced (Unix Style) Option

 

1. Click on the "Advanced (Unix Style) Option" button.

 

2. The first option request that you enter the email address where you want the output of your cron job files to be sent. Enter the email address in the text box provided.

 

3. Next, enter the Minute, Hour, Day, Month, Weekday and Command in the text boxes provided.

 

4. Next, click on the "Save Crontab" to create the cron job entry. Or if you want to reset the modifications you have made back to the default settings, click on the "Reset Changes" button.

 

6. A confirmation page will be shown stating "Cron Updated!" Click on the "Go Back" button to return to the main Cron Job screen.

  • 0 Utilizadores acharam útil
Esta resposta foi útil?

Artigos Relacionados

Sub Domains

SubdomainsThis section of the cPanel 11 manual will teach you everything you need to knowabout...

AddOn Domains

Addon DomainsWhat is an Addon Domain? An Addon Domain is similar to a subdomain andcreated in...

How Do I Login To cPanel

To access cPanel: Type: https://IP:2083 into your preferred Internet browser. IP is...