Cron Job 

Cron Jobs / Function

Drei Personen betrachten einen Laptop am Tisch mit rheinwunder Logo im Hintergrund.
By Ralph Grundmann · Last updated on 02.03.2026

A cron job is a mechanism for automating tasks on a Unix or Unix-like operating system such as Linux. Cron jobs can be executed regularly to perform specific tasks without the user having to intervene manually.
Cron jobs are particularly useful for tasks that need to be executed repeatedly, such as backups, updates, or system maintenance. They can also be used to schedule scripts that perform specific tasks at certain times or in certain intervals.

How do Cron Jobs work?

Cron Jobs are executed by the cron daemon, which runs in the background and regularly checks for scheduled tasks. Each Cron Job is stored in the so-called crontab file, which contains the schedule for executing the tasks.

The crontab file consists of five fields separated by spaces:

  • Minute (0-59)
  • Hour (0-23)
  • Day of the month (1-31)
  • Month (1-12 or Jan-Dec)
  • Day of the week (0-6 or Sun-Sat)

This means you can schedule a task to run every month on the 15th at 8 AM by adding the following line to the crontab file:

0 8 15 * * /home/user/my_script.sh

This entry indicates that the script “my_script.sh” should be executed every month on the 15th at 8 AM.

How to create a Cron Job?

Creating a Cron Job requires some basic knowledge of using the command line. Here are the steps you need to follow to create a simple Cron Job:

  1. Open the terminal and enter the command “crontab -e”. This opens the crontab file in a text editor.
  2. Enter a new line with the schedule you want to use for your Cron Job. Use the exact syntax as shown in the previous example.
  3. Save the crontab file and close the text editor.

Troubleshooting Cron Jobs

If your Cron Job is not executing as expected, there are some steps you can take to troubleshoot the issue.

First, make sure you have entered the syntax of the crontab file correctly. Also, check if the permissions for the script or file you want to execute are correct.

Another issue could be that the cron daemon was not started properly or is crashing. In this case, you should check the system log to see if there are any error messages.

If you have questions or issues regarding Cron Jobs and their configuration, feel free to contact us, we look forward to your message.

Weitere Artikel: