JustUtils
scheduleStandard Linux cron · 5 fields

Every 5 Minutes Cron Job

Use the */5 * * * * cron expression to run a Linux command every five minutes. Customize the command and copy the crontab line.

Your schedule

Edit the expression directly, or adjust one field at a time.

lightbulb

In plain English

Every 5 minutes, every day.

Next 5 execution times

Calculating upcoming times…

Start with a common schedule

Choose one to replace the expression above. Then fine-tune it.

Ready-to-paste cron line

Add the command that should run with this schedule.

terminal
*/5 * * * * /usr/local/bin/backup.sh

Tip: use full paths for scripts and commands. Cron has a smaller environment than your terminal.

warningOne important cron rule

When both “day of month” and “day of week” are restricted, traditional cron may run when either one matches. If you need a precise combination, use * in one of those fields or put the extra condition in your script.

THE SIMPLE VERSION

What is crontab?

Crontab is your computer's quiet to-do list for repeat work. You write a time pattern and a command; Linux checks the list each minute and starts the command whenever the pattern matches.

It is useful for jobs you do not want to remember: backups, report emails, cleanup tasks, or syncing data. The schedule says when; the command says what.

Using it on Ubuntu

Open your personal schedule

crontab -e

Choose an editor the first time. Paste a cron line, save, and exit.

List saved jobs

crontab -l

Shows the schedules currently installed for your user.

Remove all your jobs

crontab -r

This deletes your personal crontab immediately—use with care.

Every 5 minutes explained

How */5 * * * * behaves in a real cron setup

The step value */5 in the minute field selects 0, 5, 10, and every fifth minute after that. All other fields are unrestricted, so the pattern repeats throughout every hour and on every date.

Minute
*/5
Start at minute 0 and advance in five-minute steps.
Hour
*
Repeat the five-minute pattern during every hour.
Calendar
* * *
Run on all dates, months, and weekdays.

A practical example

Checking for new import files

A small internal application may receive CSV files in a watched directory. Running an import check every five minutes keeps the delay short without maintaining a process that watches the folder continuously. The importer should move or mark successful files so the next run can skip them.

Before saving the change

  • Use absolute paths for both the importer and its input directory.
  • Make repeated processing safe if a previous run exits after importing but before cleanup.
  • Confirm the command completes in less than five minutes or add a lock.

Common mistake to avoid

*/5 means clock minutes divisible by five; it does not mean five minutes after the previous run finishes. A job started at 10:00 is still scheduled again at 10:05 even if the first process is running.

When to choose something else

Use every fifteen minutes for work that can tolerate a longer delay. Use a message queue or event-driven trigger when each new file must be handled immediately.