ToolsCourt
Dev ToolsCron Generator
⚙️ Free Dev Tool

Cron Expression Generator

Build cron schedules visually. Get plain-English explanation, next run times, and copy-ready code for Linux, GitHub Actions, AWS, Kubernetes, Node.js and Python.

⚡ Quick Presets
🔧 Expression Builder
Minute
0-59
Hour
0-23
Day/Month
1-31
Month
1-12
Day/Week
0=Sun
0 9 * * 1-5
Runs at minute 0 at 9:00 AM, on Monday to Friday
Script path (optional)
📋 Ready-to-Use Code
# Edit crontab with: crontab -e
0 9 * * 1-5 /path/to/script.sh
📖 How to Use
1
Pick a preset or build from scratchClick any preset for common schedules. For custom schedules, edit the 5 fields directly.
2
Read the plain-English descriptionConfirms your schedule is correct before you deploy it.
3
Check the next run timesSee exactly when your job will fire next — shown in the right panel.
4
Copy code for your platformClick Linux, GitHub Actions, AWS, Kubernetes, Node.js, or Python and copy the ready-to-use code.
❓ FAQ
What is a cron expression?

A string of 5 fields (minute, hour, day-of-month, month, day-of-week) that defines when a scheduled task runs. Used by Linux, GitHub Actions, AWS, Kubernetes, and virtually every scheduler.

What does * mean?

* is the wildcard — "every valid value". In Minute it means every minute. In Hour it means every hour.

What is */5?

Step notation. */5 in Minute means "every 5th minute" — fires at 0, 5, 10, 15, 20... every hour.

Do cron jobs run in UTC?

Depends on the platform. Linux uses the server's local timezone. GitHub Actions and AWS EventBridge use UTC.

How is this different from crontab.guru?

We generate ready-to-use code for 6 platforms, show the next 8 run times with accurate Indian timezone display, and let you enter a script path for your Linux crontab line.

Related Dev Tools

🕐 Next 8 Run Times
1Mon, 20 Apr, 09:00 amNEXT
2Tue, 21 Apr, 09:00 am
3Wed, 22 Apr, 09:00 am
4Thu, 23 Apr, 09:00 am
5Fri, 24 Apr, 09:00 am
6Mon, 27 Apr, 09:00 am
7Tue, 28 Apr, 09:00 am
8Wed, 29 Apr, 09:00 am
📖 Syntax Reference
*Any value
*/5Every 5th
1-5Range 1 to 5
1,3,5Specific values
0 9 * * 1-5Weekdays 9am
*/15 * * * *Every 15 min
0 0 1 * *1st of month
📋 Field Ranges
Minute0 – 59
Hour0 – 23
Day of Month1 – 31
Month1 – 12
Day of Week0–6 (0=Sunday)
📣 New tools every week

Get instant alerts when new dev tools launch.

Join @ToolsCourt →

What Is a Cron Expression? Complete Beginner Guide

A cron expression is a string of text that tells a computer system exactly when to run a scheduled task — automatically, repeatedly, without any human involvement. The name comes from Kronos, the Greek god of time, via the Unix cron daemon (a background process) that has been scheduling tasks on Unix and Linux systems since 1975.

Cron expressions are used by virtually every scheduling system in modern software — Linux servers, GitHub Actions, AWS EventBridge, Kubernetes CronJobs, Apache Airflow, Node.js scheduling libraries, Python schedulers, and hundreds of other tools. Once you understand cron syntax, you can schedule tasks on any of these platforms using the same knowledge.

The standard cron expression consists of exactly five fields separated by spaces:

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

Each field can contain a specific value, a range, a list, a step value, or the wildcard * meaning "every valid value." The combination of these five fields can express virtually any recurring schedule — from "every minute" to "the last Friday of every third month at 11:59 PM."

The 5 Cron Fields — Complete Reference

Field 1: Minute (0–59)

The first field controls which minute(s) of the hour the job runs. 0 means the top of the hour. 30 means half past. * means every minute. */15 means every 15 minutes (0, 15, 30, 45).

Field 2: Hour (0–23)

The second field controls which hour(s) of the day. Uses 24-hour format. 0 is midnight, 9 is 9 AM, 17 is 5 PM, 23 is 11 PM. 9-17 means every hour from 9 AM to 5 PM.

Field 3: Day of Month (1–31)

The third field controls which day(s) of the month. 1 is the first of the month, 15 is the 15th, L (in some systems) is the last day. Note: if you set both day-of-month and day-of-week to non-wildcard values, most systems run the job when either condition is true (OR logic), not both.

Field 4: Month (1–12)

The fourth field controls which month(s). 1 is January, 12 is December. Some systems also accept three-letter abbreviations: JAN, FEB, MAR, etc.

Field 5: Day of Week (0–6)

The fifth field controls which day(s) of the week. 0 and 7 both represent Sunday. 1 is Monday, 5 is Friday, 6 is Saturday. Some systems accept abbreviations: MON, TUE, WED, THU, FRI, SAT, SUN.

Cron Special Characters — Every Operator Explained

CharacterNameMeaningExample
*Asterisk / WildcardEvery valid value in this field* * * * * — every minute
*/nStepEvery nth value*/5 * * * * — every 5 minutes
a-bRangeEvery value from a to b inclusive0 9-17 * * * — every hour 9am–5pm
a,b,cListSpecific values only0 9,12,17 * * * — 9am, noon, 5pm
a-b/nRange + StepEvery nth value within a range0-30/5 * * * * — minutes 0,5,10,15,20,25,30
💡 Step values are the most misunderstood. */15 does NOT mean "every 15 minutes starting from the current time." It means "every minute whose value is divisible by 15" — which is always 0, 15, 30, and 45. The division is against the field's starting value (0 for minutes and hours, 1 for days and months).

50 Cron Expression Examples — Copy and Use

Every N Minutes

ExpressionMeaning
* * * * *Every minute
*/2 * * * *Every 2 minutes
*/5 * * * *Every 5 minutes
*/10 * * * *Every 10 minutes
*/15 * * * *Every 15 minutes
*/30 * * * *Every 30 minutes
0 * * * *Every hour (at :00)
30 * * * *Every hour at :30

Daily Schedules

ExpressionMeaning
0 0 * * *Every day at midnight (12:00 AM)
0 6 * * *Every day at 6:00 AM
0 9 * * *Every day at 9:00 AM
0 12 * * *Every day at noon (12:00 PM)
0 17 * * *Every day at 5:00 PM
0 18 * * *Every day at 6:00 PM
0 23 * * *Every day at 11:00 PM
0 0,12 * * *Every day at midnight and noon
0 8,13,18 * * *Every day at 8am, 1pm, and 6pm
0 9-17 * * *Every hour from 9am to 5pm daily

Weekly Schedules

ExpressionMeaning
0 9 * * 1Every Monday at 9:00 AM
0 9 * * 1-5Every weekday (Mon–Fri) at 9:00 AM
0 9 * * 1,3,5Monday, Wednesday, Friday at 9:00 AM
0 0 * * 0Every Sunday at midnight
0 0 * * 6Every Saturday at midnight
0 0 * * 6,0Every weekend at midnight
0 9 * * 2Every Tuesday at 9:00 AM
30 18 * * 5Every Friday at 6:30 PM

Monthly Schedules

ExpressionMeaning
0 0 1 * *First of every month at midnight
0 0 15 * *15th of every month at midnight
0 9 1,15 * *1st and 15th of every month at 9am
0 0 1 1 *January 1st at midnight (New Year)
0 0 1 1,7 *January 1st and July 1st at midnight
0 9 1 * 1First of month, but only if Monday at 9am

Real-World Use Cases

ExpressionUse Case
0 2 * * *Daily database backup at 2:00 AM (low traffic)
*/5 * * * *Check server health every 5 minutes
0 9 * * 1Weekly team report every Monday morning
0 0 1 * *Monthly invoice generation
*/15 9-17 * * 1-5Check API status every 15 min during business hours
0 6 * * *Daily morning newsletter send
0 0 * * 0Weekly database cleanup every Sunday midnight
0 */4 * * *Refresh cache every 4 hours
30 23 * * *End-of-day report at 11:30 PM
0 0 1 1 *Annual data archival on New Year
*/1 * * * *Real-time data sync (every minute)
0 9-17/2 * * 1-5Every 2 hours during work hours on weekdays

Cron Syntax Differences Across Platforms

One of the most common sources of cron confusion is that different platforms use slightly different syntax. The five-field standard cron format works on Linux, but AWS, Kubernetes, and GitHub Actions each have nuances.

Linux / Unix crontab (5 fields — standard)

The original cron format. Edit with crontab -e. Runs in the server's local timezone. Each line is: expression command.

# Run backup every day at 2am 0 2 * * * /home/ubuntu/backup.sh # Clear temp files every Sunday at midnight 0 0 * * 0 /usr/bin/find /tmp -mtime +7 -delete # Email report every weekday at 9am 0 9 * * 1-5 /home/deploy/send_report.py

GitHub Actions (5 fields — UTC only)

Uses standard 5-field cron inside a YAML file. Always runs in UTC — if you're in India (IST = UTC+5:30), subtract 5 hours 30 minutes. 0 9 * * * in GitHub Actions runs at 2:30 PM IST.

on: schedule: - cron: '0 9 * * 1-5' # Every weekday at 9am UTC (2:30pm IST) jobs: deploy: runs-on: ubuntu-latest
⚠️ GitHub Actions timezone gotcha: All schedule times are UTC. To run at 9am IST, use 30 3 * * * (3:30am UTC = 9:00am IST). Also note — GitHub may delay scheduled workflows by up to 15 minutes during high-demand periods.

AWS EventBridge (6 fields — adds Year)

AWS uses a 6-field format that adds a Year field at the end. Also uses ? instead of * for "no specific value" in day fields. Always UTC.

# AWS cron format: minute hour day-of-month month day-of-week year cron(0 9 * * ? *) # Every day at 9am UTC cron(0 0 1 * ? *) # First of every month at midnight cron(0 9 ? * MON-FRI *) # Weekdays at 9am

Kubernetes CronJob (5 fields — standard)

Uses standard 5-field cron. Timezone support requires Kubernetes 1.25+. The schedule runs in the cluster's timezone by default.

apiVersion: batch/v1 kind: CronJob metadata: name: daily-backup spec: schedule: "0 2 * * *" timeZone: "Asia/Kolkata" # Requires K8s 1.25+ jobTemplate: spec: template: spec: containers: - name: backup image: backup-image:latest restartPolicy: OnFailure

Apache Airflow (5 fields + presets)

Airflow supports standard 5-field cron plus convenient preset strings: @daily, @hourly, @weekly, @monthly.

with DAG( dag_id='daily_etl', schedule_interval='0 2 * * *', # 2am daily # or use preset: # schedule_interval='@daily', start_date=datetime(2025, 1, 1), catchup=False, ) as dag:

Node.js — node-cron

The node-cron package supports a 6-field format that adds a Seconds field at the beginning. The standard 5-field cron also works.

const cron = require('node-cron'); // Standard 5-field (minutes as first field) cron.schedule('*/5 * * * *', () => { console.log('Runs every 5 minutes'); }); // 6-field with seconds (seconds as first field) cron.schedule('*/30 * * * * *', () => { console.log('Runs every 30 seconds'); });

Python — APScheduler

from apscheduler.schedulers.blocking import BlockingScheduler scheduler = BlockingScheduler(timezone='Asia/Kolkata') @scheduler.scheduled_job('cron', hour=9, minute=0, day_of_week='mon-fri') def weekday_morning_job(): print('Running every weekday at 9am IST') scheduler.start()

Cron and Timezones — The Complete Guide

Timezone handling is one of the most error-prone aspects of cron scheduling. The same cron expression can produce completely different real-world run times depending on the platform and its timezone configuration.

Which platforms use UTC by default?

  • GitHub Actions — always UTC, no way to change
  • AWS EventBridge — always UTC, no way to change
  • Most Linux servers — depends on server timezone configuration
  • Kubernetes — cluster timezone, configurable in K8s 1.25+

IST to UTC conversion for Indian developers

India Standard Time (IST) is UTC+5:30 — 5 hours and 30 minutes ahead of UTC. To convert a desired IST time to UTC for platforms that require UTC:

You want to run at (IST)Use this UTC timeCron expression
6:00 AM IST12:30 AM UTC30 0 * * *
9:00 AM IST3:30 AM UTC30 3 * * *
12:00 PM IST (noon)6:30 AM UTC30 6 * * *
6:00 PM IST12:30 PM UTC30 12 * * *
9:00 PM IST3:30 PM UTC30 15 * * *
11:59 PM IST6:29 PM UTC29 18 * * *
2:00 AM IST8:30 PM UTC (previous day)30 20 * * *
💡 Tip for Indian developers on GitHub Actions: To run a job every weekday at 9am IST, use 30 3 * * 1-5 — which is 3:30am UTC, equivalent to 9:00am IST. Don't forget the 30-minute offset that makes IST conversion non-obvious.

10 Most Common Cron Mistakes — And How to Avoid Them

Mistake 1: Forgetting the timezone difference

❌ Common mistake
0 9 * * * on GitHub Actions (expecting 9am IST)
✅ Correct approach
30 3 * * * on GitHub Actions (actually 9am IST)

GitHub Actions and AWS always run in UTC. 9:00 AM IST is 3:30 AM UTC. Always convert IST to UTC for these platforms.

Mistake 2: Using */1 instead of *

❌ Common mistake
*/1 * * * * (verbose)
✅ Correct approach
* * * * * (correct)

*/1 technically works but is redundant — every value divisible by 1 is every value. Just use * for clarity.

Mistake 3: Expecting second-level precision

❌ Common mistake
Wanting a job to run every 30 seconds
✅ Correct approach
Use a 6-field format or run a job every minute that checks a flag

Standard 5-field cron has minute-level precision. For sub-minute scheduling, use a 6-field implementation (node-cron, Quartz) or trigger from within a running process.

Mistake 4: Day-of-month AND day-of-week conflict

❌ Common mistake
0 9 15 * 1 (expecting: 9am on the 15th IF it's a Monday)
✅ Correct approach
0 9 15 * * (9am on the 15th) or 0 9 * * 1 (9am every Monday)

When both day-of-month and day-of-week are non-wildcard, most cron implementations use OR logic: runs when EITHER condition is true. This is counterintuitive.

Mistake 5: Not testing before deploying

❌ Common mistake
Writing a cron expression and deploying directly
✅ Correct approach
Using the Next Run Times checker before deploying

Always verify the next 5-10 run times before deploying a cron expression. This immediately reveals timezone mistakes, off-by-one errors, and unintended frequencies.

Mistake 6: Overlapping jobs

❌ Common mistake
A 5-minute job scheduled every 5 minutes
✅ Correct approach
Add a lock/semaphore, or schedule less frequently than the job duration

Cron launches a new instance of your job at the scheduled time regardless of whether the previous instance is still running. If your job takes 7 minutes and runs every 5, you'll have overlapping instances.

Mistake 7: Using month names but platform doesn't support them

❌ Common mistake
JAN,MAR,JUN * * * (not supported by all platforms)
✅ Correct approach
1,3,6 * * * (universally supported)

Three-letter month and day abbreviations (JAN, MON) are supported by Linux cron but not all implementations. Use numbers for maximum compatibility.

Mistake 8: Relative scheduling confusion

❌ Common mistake
Expecting */5 to run 5 minutes from "now"
✅ Correct approach
Understanding */5 runs at 0,5,10,15,20,25,30,35,40,45,50,55

Cron expressions are absolute, not relative. */5 in the minute field means "any minute divisible by 5" — always 0,5,10... regardless of when the cron daemon started.

Mistake 9: Missing the last-day-of-month edge case

❌ Common mistake
0 0 31 * * (expecting end-of-month — skips Feb, Apr, Jun, Sep, Nov)
✅ Correct approach
Use a wrapper script that checks the actual last day, or use platform-specific L syntax

Scheduling on the 31st skips months with fewer than 31 days. For true end-of-month scheduling, most platforms require a script check or the non-standard L operator.

Mistake 10: No error handling or notification

❌ Common mistake
0 2 * * * /backup.sh (no notification if it fails)
✅ Correct approach
0 2 * * * /backup.sh || mail -s "Backup failed" admin@example.com

Cron jobs fail silently by default. Always add error handling — either in the script itself or via cron's MAILTO variable — so failures don't go unnoticed.

Real-World Cron Use Cases by Industry

Software Development and DevOps

  • Automated deployments: 0 2 * * * — Deploy to staging every night at 2am for morning QA
  • Database backups: 0 3 * * * — Full backup nightly, 0 */6 * * * — Incremental every 6 hours
  • Log rotation: 0 0 * * * — Archive and compress logs daily
  • SSL certificate renewal: 0 0 1 * * — Check and renew certificates monthly
  • Security scans: 0 1 * * 0 — Weekly vulnerability scan on Sunday night
  • Cache warming: 0 5 * * * — Pre-warm caches before business hours

E-commerce and Business

  • Inventory sync: */30 * * * * — Sync with supplier every 30 minutes
  • Price updates: 0 */2 * * * — Recalculate prices every 2 hours
  • Order processing: */5 * * * * — Process new orders every 5 minutes
  • Daily sales reports: 0 8 * * 1-5 — Email sales summary weekdays at 8am
  • Monthly invoicing: 0 9 1 * * — Generate and send invoices on the 1st
  • Abandoned cart emails: 0 */1 * * * — Check for abandoned carts hourly

Data Engineering and Analytics

  • ETL pipelines: 0 1 * * * — Extract, transform, load overnight
  • Data warehouse refresh: 0 4 * * * — Refresh aggregations at 4am
  • API data ingestion: 0 * * * * — Pull data from external APIs hourly
  • Report generation: 0 6 * * 1 — Weekly business report every Monday
  • Model retraining: 0 2 * * 0 — Retrain ML models weekly on Sunday

Content and Media

  • Newsletter sending: 0 9 * * 2 — Send newsletter every Tuesday at 9am
  • Social media posting: 0 10,14,18 * * * — Post at 10am, 2pm, 6pm daily
  • Sitemap regeneration: 0 0 * * * — Rebuild and resubmit sitemap nightly
  • CDN cache purge: 0 3 * * * — Purge stale CDN content at 3am

How Cron Works — The Technical Background

The cron daemon is a background process that runs continuously on Unix and Linux systems. Every minute, it reads the crontab files (user crontabs at /var/spool/cron/crontabs/ and system crontabs at /etc/cron.d/) and checks whether any scheduled job should run in the current minute. If a job's expression matches the current time, cron launches the job as a new process.

The crontab file format

A crontab file contains one job per line. Each line has six components: the five time fields plus the command to execute. Lines beginning with # are comments.

# This is a comment # Format: min hour dom month dow command # Run backup at 2am daily 0 2 * * * /home/ubuntu/scripts/backup.sh # Send report every weekday at 9am 0 9 * * 1-5 /usr/local/bin/python3 /home/app/report.py # Clear old temp files every Sunday at midnight 0 0 * * 0 find /tmp -type f -mtime +7 -delete # Environment variables can be set at the top MAILTO=admin@example.com PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

System cron vs user cron

User crontab (crontab -e): Runs jobs as the current user. Jobs defined here are in /var/spool/cron/crontabs/username.

System crontab (/etc/crontab and /etc/cron.d/): Has an additional field for the username to run the job as. Used for system-level tasks.

# /etc/crontab format (extra username field after time fields) 0 2 * * * root /usr/local/bin/system-backup.sh 0 3 * * * www-data /var/www/app/scripts/cleanup.py

Cron shorthand macros

Most cron implementations support convenient named schedules as alternatives to the 5-field expression:

MacroEquivalentMeaning
@reboot(special)Run once at system startup
@yearly / @annually0 0 1 1 *Run once a year
@monthly0 0 1 * *Run once a month
@weekly0 0 * * 0Run once a week (Sunday)
@daily / @midnight0 0 * * *Run once a day at midnight
@hourly0 * * * *Run at the start of every hour

History of Cron — From Unix 1975 to Modern Cloud Schedulers

Cron has a surprisingly long history for a piece of software that most developers take for granted. Understanding its origins explains some of the design decisions that can seem arbitrary today.

1975 — The original Unix cron

The first cron was written by Brian Kernighan (co-creator of C and Unix) at Bell Labs. This version was simple: it woke up once a minute and ran any jobs scheduled for that time. It had a single crontab shared by all users.

1977 — Multiple user crontabs

Ken Thompson rewrote cron to support per-user crontabs, the design that survives to this day. This version introduced the familiar five-field expression format.

1987 — The Vixie cron

Paul Vixie released a rewrite of cron in 1987 that became the most widely deployed version. Vixie cron added the @reboot, @daily, and similar macros, as well as the MAILTO variable for error reporting. This version (or derivatives) is what ships with most Linux distributions today — over 35 years after it was written.

1994 — Quartz Scheduler (Java)

The Quartz job scheduling library introduced a six-field cron format that added a Seconds field at the beginning and a Year field at the end. Quartz cron is the standard for Java applications and influenced the AWS EventBridge expression format.

2006 — Amazon CloudWatch Events (predecessor to EventBridge)

AWS adapted the Quartz cron format for cloud infrastructure scheduling, with modifications for their specific use case. This brought cron syntax to cloud-scale infrastructure management, where expressions could trigger serverless functions, container tasks, and other cloud resources.

2011 — GitHub Actions (originally GitHub CI)

GitHub's CI/CD platform adopted standard 5-field cron for scheduled workflows, bringing cron into the modern DevOps workflow. Today millions of developers write GitHub Actions workflows with cron schedules to automate testing, deployment, and maintenance tasks.

2020s — Kubernetes CronJobs and Apache Airflow

Container orchestration and data pipeline platforms have made cron expressions part of the daily vocabulary for DevOps engineers and data engineers. Kubernetes CronJobs use standard cron to schedule batch workloads. Apache Airflow uses cron for DAG (Directed Acyclic Graph) scheduling. The expression format that Brian Kernighan wrote in 1975 now schedules tasks on some of the world's largest computing infrastructure.

Cron vs Other Scheduling Approaches

Cron vs Message Queue Schedulers (RabbitMQ, Redis, SQS)

Cron triggers jobs based on time. Message queues process tasks based on demand. For tasks that must run at specific times (daily reports, weekly backups), cron is the right tool. For tasks that should run in response to events (process every uploaded image, send email when user signs up), a message queue is the right tool. Many production systems use both: a cron job fires every hour to enqueue tasks that the queue workers process.

Cron vs Interval-based scheduling (setInterval)

setInterval in JavaScript or time.sleep loops in Python run relative to when the process started. If your server restarts, the interval resets. Cron runs at absolute wall-clock times regardless of restarts. For production systems that need predictable, drift-free timing, cron is more reliable than application-level interval loops.

Cron vs Workflow orchestration (Airflow, Prefect, Dagster)

Cron executes a command at a scheduled time with no awareness of dependencies between jobs. Workflow orchestrators like Airflow define directed acyclic graphs where Job B only starts after Job A succeeds. For simple isolated tasks, cron is sufficient. For complex pipelines where task B depends on task A's output, use a workflow orchestrator — which itself often uses cron expressions for its schedule.

Cron Expression Generator — Frequently Asked Questions

Does this cron generator support Quartz / Java cron (6 fields)?
The generator uses standard 5-field cron. AWS EventBridge uses a variant of Quartz cron — the AWS tab in the code output adds the required cron() wrapper and ? syntax for that platform. For full Quartz 6-field support (with seconds), you'll need to prepend the seconds field (typically 0) to the generated expression.
How do I run a cron job every 10 seconds?
Standard 5-field cron has minute-level precision — the smallest interval is every minute (*/1 * * * * or * * * * *). For sub-minute scheduling, use a 6-field cron implementation like node-cron (*/10 * * * * * for every 10 seconds), or have your every-minute job check elapsed time internally.
Why is my cron job not running at the expected time?
The five most common causes: (1) timezone mismatch — the platform runs in UTC but you're expecting local time; (2) cron daemon not running — check with systemctl status cron; (3) permission issue — the script file may not be executable (chmod +x your_script.sh); (4) PATH issue — cron runs with a minimal PATH, use full paths to all commands; (5) environment variables — cron doesn't source .bashrc, so variables available in your shell may not be available to the cron job.
Can I run a cron job every month on the last day?
Standard cron doesn't have a built-in "last day of month" concept. Options: (1) Use the L operator if your platform supports it (Quartz, some Linux crons): 0 0 L * *; (2) Schedule on the 28th (works for all months): 0 0 28 * *; (3) Schedule daily and have your script check if tomorrow is the 1st.
What is the difference between 0 * * * * and * * * * *?
0 * * * * runs at minute 0 of every hour — once per hour. * * * * * runs every minute — 60 times per hour. The first field is minutes, so 0 means "only when the minute counter is 0" (top of the hour), while * means "every minute."
How do I test a cron expression before deploying it?
The best way is to use this generator's Next Run Times panel — it shows the next 8 times your expression will fire so you can verify the schedule is correct before deploying. For Linux, you can also temporarily set a cron job to run every minute with a test command (echo "test" >> /tmp/cron_test.txt) to confirm cron is working, then replace it with your actual command.
Can cron expressions span multiple days for a single run?
No. Each cron execution is a single point in time. If you need a task to run for an extended period (e.g., a backup that takes 3 hours), the cron job just starts the process — the process itself runs until completion regardless of when the next cron tick occurs. Cron has no awareness of how long its spawned processes run.
What happens if a cron job is still running when the next scheduled time arrives?
By default, cron starts a new instance of the job regardless of whether the previous one is still running. If your job takes longer than its schedule interval, you'll have multiple instances running simultaneously. Prevent this with a file lock: the script checks for a lock file on startup and exits if one exists, creating the lock file before its main work and removing it when done.