⌚ What is cron and what are cron jobs: practical guide with examples and online exercises

  

When working in the world of Linux systems or managing web servers, sooner or later you come across a powerful and silent ally: cron

In this article we will start from the basics to explain what it is, what it is used for and how to use the so-called cron jobs. At the end, we will also see a free online tool that allows you to create cron jobs without having to use the terminal: cron-job.org.

🔗 Do you like Techelopment? Check out the site for all the details!

What is cron?

cron is a system daemon (i.e. a background process) present in most Linux/Unix distributions. Its job is very simple: execute commands or scripts at set times.

The name "cron" comes from the Greek chronos, which means time. In fact, its main function is precisely that of managing operations scheduled over time.


What are cron jobs?

A cron job is a single scheduled task that is executed by cron according to a specific schedule. This may include:

  • Automatic daily backups
  • Sending periodic emails
  • Cleaning temporary files every hour
  • Monitoring the health of a server every 5 minutes

How cron syntax works

Cron jobs are typically written to the crontab file, which can be accessed using the command:

crontab -e

Each line represents a job and follows this syntax:

* * * * * command_to_execute
│ │ │ │ │
│ │ │ │ └── Day of the week (0 - 7) (Sunday = 0 or 7)
│ │ │ └──── Month (1 - 12)
│ │ └─────  Day of the month (1 - 31)
│ └──────── Hour (0 - 23)
└────────── Minute (0 - 59)

Example: run check_site.sh every hour

0 * * * * /absolute/path/check_site.sh
Meaning:
  • 0 → at minute zero
  • * → every hour
  • * → every day of the month
  • * → every month
  • * → every day of the week

Practical examples:

Objective Cron Syntax Explanation
Run every minute * * * * * Every minute, hour, day, and month
Every day at 3:00 0 3 * * * Every day at 3:00
Every Monday at 8:30 30 8 * * 1 At 8:30 every Monday
Every 5 minutes */5 * * * * Every 5 minutes, every day

How to test cron jobs without a terminal: cron-job.org

If you don't have a Linux server available or you just want to try cron jobs online, there is a very useful service useful: https://cron-job.org

What is cron-job.org?

It is a free service (with registration) that allows you to run HTTP requests at regular intervals, just like you would with a cron job on Linux. It is perfect for:

  • Monitor website uptime
  • Run periodic web scripts (PHP, Node.js, etc.)
  • Simulate scheduled tasks on online projects

Example: monitor if our site is up

Let's say we want to check every 10 minutes if our site is online. Here's how to set up this cron job with cron-job.org.

Steps:

  1. Register for free at https://cron-job.org
  2. Log in to your control panel
  3. Click on "Create Cronjob"
  4. Fill out the form:
    • URL: https://www.mysite.com
    • Schedule: every 10 minutes (Every 10 minutes)
    • Request method: GET
    • Notify on failure: ✅ (so you get notified if the site doesn't respond)
  5. Save

From now on, cron-job.org will send a request to your site every 10 minutes. If the site returns an error (e.g. 500, 404, or not responding), you will receive an email alert.


Conclusion

Cron jobs are essential tools for automating periodic tasks, and cron is one of the most powerful and long-lived services in the Unix/Linux world. Whether you are managing a website, a server, or just a script that you run every day, learning how to use cron will make your life easier.

What if you don't have a server available? No problem: tools like cron-job.org let you test and use real cron jobs with just a few clicks.



Follow me #techelopment

Official site: www.techelopment.it
facebook: Techelopment
instagram: @techelopment
/>whatsapp: Techelopment
youtube: @techelopment