blog posts

Training Cron Jobs in cPanel

Cron Jobs in Farsi is a tool that is used to execute specific commands at a specific time. If we want to have a specific process or function at a specific time or with repetition in host a Linux-based Considering that there is no comprehensive and complete training in this field on the Persian web, we have decided to introduce you to this widely used feature in Linux and teach you how to work with it.

Training Cron Jobs cPanel

As mentioned, Cron Jobs is a feature of Linux-based operating systems. But in web hosting, this feature is provided as a tool to host users. In this tutorial, we will introduce and teach Cron Jobs with the CPanel control panel. To access the Cron Jobs tool, just proceed as follows:

  • Login to cPanel
  • Click on the Cron Jobs option located in the ADVANCED section

Before starting the work, it should be noted that there is a section called Cron Email on the special page. As shown in the image below, where you can enter your email so that Cron Jobs execution or error messages will be sent to you.

Training Cron JobsNote that if the execution cycle of Cron Jobs is close, it is better to avoid entering the email. The reason is that if, for example, the execution cycle of a job limit is every 5 minutes, 288 emails will be sent to you within 24 hours, and this issue may cause problems in terms of sending mass emails from the host.

How to create Cron Jobs in cPanel

The most common application of kran jobs in the host is to call executive commands. These commands can be in hundreds of different modes and can be considered based on the need. One of the most important applications of Cron Jobs in FA host is in WHMCS automation. As you know, several thousands of users are members of the Fa host user area portal system, and all of them have active services. Issues such as invoicing, notification for renewal, suspension, unblocking, and dozens of other cases cannot be managed normally and with the performance of human resources! So here is the solution to run automatically and do the mentioned things.

Creating Cron Job types in CPanel

As mentioned, the types of commands and allowed functions can be defined in the job limit. Here are some examples:

Example 1: Suppose we want to run the task.php file in the home/user/public_html path every 30 minutes.

To do this, just select Twice Per Hour from the Common Settings drop-down menu, as shown in the image below.

Cron Job in cPanelWith this, other time options will be completed automatically. Next, to run cron jobs, just click on the Add New link to include it in the list of executive tasks.

Example 2: suppose we want the file task.php to be executed in the home/user/public_html path on the 10th day of every month at 14:30!

For this purpose, you must set the items in the image below.

Kiran Jobs

With the above examples, it is usually clear how to work with Jobs, but if you still have any doubts or questions. Please raise them in the comments section so that they will be answered.