What are Cron Jobs and what are they used for?
Many tasks on a website or server must be repeated periodically: creating a backup, updating a store’s inventory, cleaning temporary files, or sending a report. Doing it manually not only takes time but also increases the risk of forgetfulness and errors.
A Cron Job allows you to schedule these actions to run automatically at the time or frequency you choose. In this article, we will see what a Cron Job is, how it works, and how you can configure it from your hosting.
Table of Contents
- What is a Cron Job?
- Differences between cron, crontab, and Cron Job
- What are Cron Jobs used for?
- What parts make up a Cron Job?
- How to indicate the frequency of a Cron Job
- Examples of Cron Jobs
- How to configure a Cron Job in your cdmon hosting
- Cron Jobs and WordPress: are they the same as WP-Cron?
- Best practices when configuring scheduled tasks
- Common errors when configuring a Cron Job
- How to check if a Cron Job works
- Frequently asked questions about Cron Jobs
What is a Cron Job?
A Cron Job is a scheduled task that a system automatically executes on a specific date, time, or frequency.
You can think of it as an alarm for the server. You define what it should do and when it should do it; when the indicated time arrives, the system executes the task without you having to intervene.
Cron is a system native to Unix and derived systems, such as Linux. Therefore, Cron Jobs are common on servers and hosting services that use these systems. To perform scheduled tasks, they can execute a command (a direct instruction for the server), a script (a small program that gathers several instructions), or automatically access a URL to trigger a specific action.
Differences between cron, crontab, and Cron Job
Although they are often used as synonyms, these concepts do not mean exactly the same thing:
- Cron is the system service that checks the schedule and executes the tasks.
- Crontab is the file or configuration where the scheduled tasks are stored.
- Cron Job is each of the specific tasks that have been configured.
In other words, cron is the one who checks the calendar, crontab contains the instructions, and the Cron Job is the action that must be performed.
What are Cron Jobs used for?
Cron Jobs are used to automate processes that need to be executed periodically. Here are some of their most common uses.
Create database backups
You can schedule a Cron Job to periodically create a backup of your website’s database. It can store important information, such as users, settings, entries, or the orders and sales of an online store.
Thus, if a problem occurs, you will have a recent copy of the data that changes most frequently.
Keep in mind that these copies will take up space if stored within the hosting itself. Therefore, it is important to control how much space they consume, delete old copies you no longer need, and, whenever possible, save another copy in an external and secure location.
It is also advisable to periodically check that the copies are created correctly and that they can be used to recover the information.
Clean temporary files and logs
Temporary files, caches, and logs can accumulate over time and take up unnecessary space. A Cron Job can periodically delete them according to the criteria you have defined.
Execute maintenance tasks
They can also be used to synchronize data, generate reports, process files, update information, or execute other internal processes of an application.
Send scheduled notifications
A Cron Job can trigger the sending of reminders, alerts, periodic reports, or transactional emails. The sending must be managed through a script or an application prepared for it.
Automate processes of an online store
In an ecommerce, scheduled tasks can be used to update inventories, synchronize orders, generate invoices, or import information from other systems.
What parts make up a Cron Job?
Before seeing examples, it is important to understand what information a Cron Job contains. A scheduled task basically needs to indicate two things: when you want it to be executed and what you want it to do.
For example:
0 3 * * * /path/script.shAlthough it may seem complicated at first, this instruction is divided into two very simple parts:
When should it be executed
0 3 * * *The five values indicate the moment you want the task to be performed:
minute | hour | day of the month | month | day of the week
0 | 3 | * | * | * In this case, it means: every day at 03:00.
The asterisks (*) mean «any value.» Therefore, by placing * in day, month, and day of the week, we are not limiting the task to a specific date.
What should be executed
/path/script.shThis second part indicates what the server has to do when that moment arrives.
In the example, the path of a script is used, that is, a file that contains the instructions of the task we want to perform. It could be, for example, a script responsible for creating a backup.
Therefore:
0 3 * * * /path/script.shcan be simply read as:
«Every day at 03:00, execute this script.»
In cdmon, you can create and manage these tasks directly from the Control Panel. Later, we will see step by step where to find this option and how to configure it.
Where is all this configured?
The way to configure a Cron Job depends on the server or hosting service you use. On a server, it can be done through the crontab file, while some hosting providers offer an interface to configure it more easily.
How to indicate the frequency of a Cron Job
If you configure the Cron Job from the cdmon Control Panel, you usually won’t have to write these expressions manually, as you can select the frequency through more visual fields and options. Even so, knowing its structure will help you understand how each task is scheduled and create more specific schedules.
As we have seen, the first five positions of a Cron Job indicate when the task should be executed. In addition to entering a specific number, we can use some symbols to create more flexible schedules.
For example, we can indicate that a task is executed every day, every 15 minutes, or only from Monday to Friday.
The most common symbols are:
| Symbol | What it is used for | Example |
|---|---|---|
| * | Includes all possible values | * in hours = all hours |
| , | Allows selecting several specific values | 1,3,5 = Monday, Wednesday, and Friday |
| – | Includes all values within an interval | 9-17 = from 09:00 to 17:59 |
| / | Repeats the task every certain number of units | */10 = every 10 minutes |
The values used to represent the days of the week may depend on the system. Usually, 1 corresponds to Monday and 0 or 7 to Sunday.
The dash -: an interval
The dash allows including all values between two numbers. For example:
9-17
If it appears in the hours field, it means that the task can be executed from 09:00 to 17:59.
It can also be used in other fields. For example, 1-5 in the day of the week usually represents Monday to Friday.
The slash /: a repetition
The slash allows establishing how many units a task should be executed. It is usually combined with an asterisk:
*/15
The asterisk represents all possible values of the field and /15 indicates that they should be taken every 15.
If */15 appears in the minutes field, the task will be executed at minutes 00, 15, 30, and 45 of each hour.
For example:
*/15 * * * *
It is interpreted as follows:
- */15: every 15 minutes.
- The second *: any hour.
- The third *: any day of the month.
- The fourth *: any month.
- The fifth *: any day of the week.
Therefore, the task will be executed every 15 minutes, every day.
Important: cron follows specific clock positions. It does not wait 15 minutes from when the previous execution ends. For example, even if a task started at 10:00 ends at 10:04, the next one will still be scheduled for 10:15.
Examples of Cron Jobs
These examples show how some of the most common expressions are interpreted. The path and command must be adapted to the server and the script you want to execute.
Execute a task every hour
0 * * * * /path/script.shThe task will be executed at the beginning of each hour.
Execute a task every day at 03:00
0 3 * * * /path/script.shThe first value indicates minute 0 and the second, hour 3.
Execute a task every 15 minutes
*/15 * * * * /path/script.shIn this case, the task will be executed four times each hour.
Execute a task every Monday at 09:30
30 9 * * 1 /path/script.shThe 1 in the last field represents Monday.
Execute a task on the first day of each month
0 0 1 * * /path/script.shThe task will start at 00:00 on the 1st of each month.
Example combining several symbols
*/10 9-17 * * 1-5This expression indicates that the task will be executed every 10 minutes, between 09:00 and 17:59, from Monday to Friday.
How to configure a Cron Job in your cdmon hosting
If you have hosting in cdmon, you can easily create and manage your scheduled tasks from the Control Panel. You don’t need to use commands or have advanced technical knowledge. (add images)
1. Access the hosting management
Enter the Control Panel, select the corresponding hosting, and go to: Server > CRONJobs

2. Choose the type of configuration
The panel offers two options:
- Basic configuration: allows selecting the frequency through a simple form.
- Advanced configuration: provides more precise control over minutes, hours, days, months, and days of the week.
The basic configuration is sufficient for most periodic tasks. You can use the advanced one when you need to set a more specific schedule.
3. Identify the task
Enter a name that allows you to easily recognize the Cron Job. Using descriptive names is especially useful when you have several scheduled tasks.
For example:
update-inventory
4. Enter the resource to be executed
Indicate the call to the script you want to execute. In the cdmon panel, this call can be configured via HTTP or HTTPS and include the parameters the process needs.
Before saving the task, check that the address is correct and that the script works when executed manually.
5. Set the frequency
Select the minutes, hours, days, and months in which it should be executed. In advanced mode, you can also define a specific day of the week.
Do not schedule a task with a higher frequency than necessary. Running a heavy process every minute that only needs to be done once a day can increase the resource consumption of the hosting.

6. Activate email confirmation if needed
You can request that the system send you the result of each execution by email. Keep in mind that you will only receive the message when the script generates some output.
Therefore, not receiving an email does not necessarily mean that the task has failed: it may also indicate that the script has been executed without returning any result.

You can check all the steps in the guide on how to configure CRONJobs or scheduled tasks from cdmon.
Cron Jobs and WordPress: are they the same as WP-Cron?
No. Both allow scheduling tasks, but they do not work the same way:
- A server Cron Job executes a task when the scheduled date or time arrives.
- WP-Cron is the system WordPress uses to manage its own scheduled tasks. It usually checks if there is any pending task when someone visits the website.
For example, if you schedule a post to be published at 10:00, WP-Cron is responsible for publishing it. However, if the website does not receive any visits at that time, the publication could be delayed until a new visit occurs.
What tasks does WP-Cron perform?
WordPress and some plugins (such as WooCommerce, UpdraftPlus, Wordfence, or MailPoet) can use WP-Cron to:
- Publish scheduled posts.
- Check for available updates.
- Create backups using plugins.
- Send scheduled alerts or emails.
- Execute periodic maintenance tasks.
What problems can it cause?
Since WP-Cron is usually activated by visits to the website, its operation partly depends on traffic:
- If the website receives few visits, some tasks may be executed later than expected.
- If it receives many, WordPress may check too frequently if there are pending tasks, unnecessarily increasing resource consumption.
WordPress plugins to manage WP-Cron
If you use WordPress, there are plugins that allow you to consult and manage WP-Cron’s scheduled tasks from the administration panel itself:
- WP Crontrol allows you to consult, edit, delete, and manually execute WordPress scheduled events.
- Advanced Cron Manager offers tools to consult, pause, modify, delete, and create WP-Cron events and frequencies.
These plugins can help you detect tasks that fail, repeat too frequently, or consume more resources than expected. However, they do not perform these actions on their own or manage server Cron Jobs.
When is it convenient to use a server Cron Job?
You can configure a server Cron Job to activate WP-Cron at a determined frequency. This way, WordPress tasks are executed more regularly and no longer depend on visits.
This configuration can be useful for:
- Avoiding delays in scheduled tasks.
- Reducing unnecessary checks.
- Controlling how often WP-Cron is executed.
- Better managing hosting resources.
To apply this change, you must first prevent WordPress from activating WP-Cron with each visit and then configure a Cron Job on the server to execute it periodically. You can check all the steps in our guide on how to reduce the consumption of wp-cron.php in a cdmon hosting.
Important: do not disable the automatic activation of WP-Cron without first configuring an alternative. Otherwise, scheduled posts, backups, and other WordPress tasks may stop executing.
Best practices when configuring scheduled tasks
A correct frequency does not guarantee by itself that the task will work well. You must also consider how it is executed and what happens if an error occurs.
First check that the task works
Before scheduling a task to run automatically, check that the action works on its own.
For example, if the Cron Job must access a URL to start a process, first open that address in the browser. If it must execute a script (a file containing the task instructions), run it once manually.
This way, you can check for errors before automating it. If the action does not work when started manually, it will not work when the Cron Job tries to execute it.
Indicate the full location of the file
When configuring the task, indicate the exact location of the script within the server. Do not just write the file name, as Cron may not know where to find it.
For example, instead of indicating:
backup.sh
use the full path:
/home/user/scripts/backup.shIf the script needs a specific program to run, such as PHP or Python, it may also be necessary to indicate its full location. This avoids errors, as Cron does not always use the same configuration as a manually opened terminal.
Apply the minimum necessary permissions
Configure the task with a user who has only the permissions necessary to perform it. For example, if it only needs to create a copy of a folder, it does not need access to the entire server.
Thus, if the script contains an error or a security problem occurs, the damage it could cause is limited.
Protect credentials
Do not include passwords, tokens, or other sensitive data directly in a URL or command that may be visible in logs, histories, or email messages.
If the script needs authentication, use a secure method to store and retrieve the credentials.
Avoid simultaneous executions
If a task takes longer to finish than the established interval, a new execution may start while the previous one is still active. This can cause duplications or increase CPU, memory, and disk consumption.
Before setting a high frequency, calculate how long the process takes and, if necessary, incorporate a locking system to prevent overlap.
Check the time zone
The time used by cron depends on the server configuration. Check that it matches the time zone you expect, especially if you need to execute actions at a specific time.
You should also consider daylight saving time changes.
Keep a record of executions
Whenever possible, make the script record:
- When it starts.
- When it ends.
- What result it obtained.
- If any error occurred.
These records will help you discover if the task has not been executed or if it started correctly but failed during the process.
The way to create this record depends on the script used. The script itself may be prepared to write the information to a file or, if you configure the task using commands, you can indicate that its output is saved to a specific file.
Then, you can open that file to check if the task was executed correctly or if it stopped due to an error.
Avoid saving the records in a public folder of the website, as they may contain paths or other technical information. It is also advisable to delete or archive old records periodically so they do not take up too much space.
Distribute tasks
Avoid scheduling all processes at the same time. Distributing them reduces consumption peaks and helps hosting resources be available when each task needs them.
Common errors when configuring a Cron Job
When a task does not execute as expected, it is usually due to one of these reasons.
The schedule has an incorrect format
Check that the expression has the five necessary fields and that they are placed in the correct order. If you copied it from another tool, check that it is compatible: some systems add a field for seconds, while the traditional cron format does not use it.
The path or URL does not exist
Check that the file is actually in the indicated location and that you have not made any mistakes when writing the address.
The script does not have the necessary permissions
The user executing the Cron Job must have permission to access the file and perform the actions included in the script.
Missing environment variables
Cron usually runs with a more limited environment than a terminal. A command that works manually may fail if it depends on a variable, path, or configuration that cron does not know.
Use full paths and explicitly define the values the process needs.
The time does not match
If the task is executed before or after expected, check the server’s time zone and the configuration of the application itself.
The frequency is too high
Executing a task every minute does not always mean it will finish sooner. If the process is heavy, an excessive frequency can cause several simultaneous executions and affect the hosting’s performance.
How to check if a Cron Job works
You can follow this process to verify a new task:
- First test the action manually. Execute the script or open the URL to confirm it works before automating it.
- Set up a test execution. Temporarily schedule the Cron Job to activate within a few minutes, instead of waiting for its final schedule.
- Wait for it to execute automatically. Do not manually start the action again during the test.
- Check the result. Check if the file, backup, or any other expected element has been created or modified.
- Consult the logs. If the task did not work, review the logs to locate possible errors in the path, permissions, or the script itself.
- Set the final schedule. Once you have confirmed everything works, configure the frequency you will use regularly.
- Review the first executions. Monitor the task during the first few days to ensure it continues to work correctly.
If you have activated email confirmations from the Control Panel of cdmon, you will only receive a message when the script generates some response or information. Not receiving an email does not necessarily mean that the task has not been executed.
Frequently asked questions about Cron Jobs
A Cron Job is a task that a server automatically executes on a specific date, time, or frequency. It is used to automate repetitive processes without manual intervention.
It is used to execute scripts, commands, or calls to a URL periodically. It can be used to create backups, clean files, send notifications, or synchronize information.
It means that the task is scheduled to run every minute. The five asterisks represent the minute, hour, day of the month, month, and day of the week.
The expression 0 3 * * * schedules a task every day at 03:00, according to the time zone used by the server.
Cron is the service that checks and executes tasks. Crontab is the file or configuration where their schedules and commands are defined.
Yes. A heavy task, too frequent, or with several simultaneous executions can consume CPU, memory, and disk space. Therefore, you must adjust its frequency and control how long it takes to complete.
No. WP-Cron is the scheduled task system of WordPress and is usually activated by visits or requests to the website. A server Cron Job can be executed with a fixed frequency without depending on traffic.
You can review the script logs, check the generated result, or activate email confirmations available in the Control Panel of cdmon.