Linux · cron · made simple

Visual cron job generator
for Linux & macOS

Build valid crontab expressions in a few clicks. See exactly when each job will run, decode existing crontabs and copy a ready-to-paste line for your terminal.

1

Your cron expression

Edit the fields directly, or click cells in the visual selectors below. Everything updates live.

0-59
0-23
1-31
1-12
0-6 · Sun=0
* * * * *
📖 Every minute
Valid expression
2

Pick the schedule visually

Click any cell to toggle it on or off. The shortcut chips set common patterns in one click.

Minute every minute

Hour every hour

Day of month every day

Month every month

Day of week every weekday

3

When will it actually run?

The next 5 firings, computed in your local time zone ().

    4

    Build the full crontab line

    Type the command you want to run, choose where its output should go, then copy the ready-to-paste line into crontab -e.

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

    Open your crontab with crontab -e and paste this on its own line. Save & exit — cron reloads automatically, no service restart needed.

    Crontab decoder

    Paste an existing crontab below — every line gets a plain-English explanation. Comments, environment variables and @-shortcuts are all recognized.

    Paste a crontab on the left to see it explained line by line.

    Quick presets

    Click to load into the generator

    Real-world cron jobs

    Common sysadmin tasks with the cron line that runs them

    Using cron on Linux — the short version

    Everything you need to actually install and debug a cron job

    1. Open your crontab

    Each user has their own crontab. Edit yours with:

    crontab -e

    The first time it asks which editor to use (nano is the friendliest). To list current entries:

    crontab -l

    To remove everything (be careful):

    crontab -r

    2. Paste your line

    Each entry is exactly one line. Copy the line built above and paste it on its own line in the editor. Save and quit — cron reloads automatically. No daemon restart needed.

    Example:

    0 3 * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1

    3. Where output goes

    By default cron emails anything a job prints to the local user (or the address in MAILTO=). On most modern servers there is no mail setup, so output silently disappears — that is why redirecting is recommended:

    • >> file.log 2>&1 — append stdout and stderr to a file
    • >/dev/null 2>&1 — throw it away
    • 2>&1 | logger -t myjob — send it to syslog/journald

    4. Where it actually runs

    cron starts the command with a minimal environment — usually just HOME, LOGNAME, PATH=/usr/bin:/bin and a basic shell. So:

    • Use absolute paths for binaries: /usr/bin/python3, not python3.
    • Anything you set in ~/.bashrc is not available.
    • The working directory is $HOME. cd into the right folder if needed.

    5. User vs system crontab

    Two different things live side by side:

    • User crontabs live in /var/spool/cron/crontabs/<user> and are edited with crontab -e. Five fields, then the command.
    • System crontab is /etc/crontab and the drop-ins in /etc/cron.d/. These have six fields — an extra user column before the command.
    • Drop-in dirs /etc/cron.{hourly,daily,weekly,monthly}/ just run any executable script in them on that schedule — no cron syntax needed.

    6. Test before you wait

    Run the exact line first by hand to make sure it works under a stripped environment:

    env -i HOME="$HOME" PATH=/usr/bin:/bin sh -c '/usr/local/bin/backup.sh'

    Then check cron is running and watch its log:

    systemctl status cron        # Debian/Ubuntu
    systemctl status crond       # RHEL/Fedora
    journalctl -u cron -f        # live log of executions

    7. Time zones

    cron uses the system time zone. Check yours:

    timedatectl

    If you need a job in a different zone, prefix the command:

    0 9 * * * TZ=Europe/Bucharest /opt/run.sh

    8. Don't let jobs overlap

    If a job might still be running when the next tick fires, wrap it in flock:

    */5 * * * * flock -n /tmp/job.lock /opt/job.sh

    The -n means "fail immediately if locked" — the second invocation simply skips that minute.

    Cron syntax cheatsheet

    Everything you need on one screen

    Field layout

    ┌───────── minute        (0-59)
    │ ┌─────── hour          (0-23)
    │ │ ┌───── day of month  (1-31)
    │ │ │ ┌─── month         (1-12)
    │ │ │ │ ┌─ day of week   (0-6, Sun=0)
    │ │ │ │ │
    * * * * *  command

    Operators

    *any value
    ,list (1,3,5)
    -range (1-5)
    /step (*/15)
    Llast day of month
    ?any (Quartz only)

    Special strings

    @rebootonce at boot
    @yearly0 0 1 1 *
    @monthly0 0 1 * *
    @weekly0 0 * * 0
    @daily0 0 * * *
    @hourly0 * * * *

    Crontab commands

    crontab -eedit your crontab
    crontab -llist it
    crontab -rremove all entries
    crontab -u user -eedit another user's
    systemctl status cronservice status
    journalctl -u cron -flive execution log

    Pro tips for healthy cron jobs

    01
    Use absolute paths

    cron runs with a minimal PATH. Write /usr/bin/python3, not python3.

    02
    Test by hand first

    Run the exact command yourself before scheduling it. Most cron failures are simple environment issues.

    03
    Capture output

    Add >> /var/log/job.log 2>&1 so errors don't vanish into thin air.

    04
    Prevent overlap

    Use flock -n /tmp/job.lock for jobs that should never run concurrently.

    05
    Mind the time zone

    cron follows the system time zone. Check it with timedatectl.

    06
    Get notified on failure

    Use a service like healthchecks.io to be alerted when a job stops checking in.

    Copied to clipboard ✓