⏰ Cron Job Generator

Create, validate & test cron expressions visually

🎯 What is a Cron Job?

A cron job is a scheduled task that runs automatically at specified intervals on Unix-based systems. Perfect for backups, email reports, database cleanup, API calls, and any recurring task. Use this generator to create the correct cron expression without memorizing complex syntax.

πŸ”§ Visual Cron Builder

Your Cron Expression

* * * * *
Runs every minute

πŸ• Next 5 Scheduled Runs:

    πŸš€ Advanced Features

    ⚑ Popular Cron Examples

    Every 5 minutes
    */5 * * * *
    Run every 5 minutes
    πŸ’‘ API sync, cache warming, frequent backups
    Every hour
    0 * * * *
    Run at minute 0 of every hour
    πŸ’‘ Hourly reports, data aggregation
    Daily at midnight
    0 0 * * *
    Run at 00:00 every day
    πŸ’‘ Daily backups, cleanup tasks, reports
    Daily at 2 AM
    0 2 * * *
    Run at 02:00 every day
    πŸ’‘ Database optimization, off-peak tasks
    Every Monday at 9 AM
    0 9 * * 1
    Run at 09:00 every Monday
    πŸ’‘ Weekly reports, team notifications
    First day of month
    0 0 1 * *
    Run at 00:00 on first day of month
    πŸ’‘ Monthly billing, invoices, reports
    Every 15 minutes
    */15 * * * *
    Run every 15 minutes
    πŸ’‘ Moderate frequency tasks
    Weekdays at 8 AM
    0 8 * * 1-5
    Run at 08:00 Monday through Friday
    πŸ’‘ Business hours tasks, office automation
    Every 30 minutes
    */30 * * * *
    Run every 30 minutes
    πŸ’‘ Regular health checks, moderate polling
    Every Sunday at midnight
    0 0 * * 0
    Run at 00:00 every Sunday
    πŸ’‘ Weekly maintenance, backups

    πŸ“š How to Set Up Cron Jobs

    Setting up Cron Job in cPanel

    1. Log in to your cPanel account
    2. Navigate to "Advanced" section
    3. Click on "Cron Jobs"
    4. Select cron timing or use custom expression
    5. Enter the command to run
    6. Click "Add New Cron Job"

    Example Command:

    /usr/local/bin/php /home/username/public_html/script.php
    πŸ’‘ Pro Tip:

    Always test your cron job manually first to ensure the script runs correctly. Add output redirection (>> /path/to/logfile.log 2>&1) to capture errors and debug issues.

    Setting up Cron Job in DirectAdmin

    1. Log in to DirectAdmin
    2. Go to "Advanced Features"
    3. Click "Cronjobs"
    4. Click "Create New Cronjob"
    5. Enter cron expression (minute, hour, day, month, weekday)
    6. Enter command to execute
    7. Click "Create"

    Example Command:

    /usr/local/bin/php /home/username/domains/example.com/public_html/cron.php
    πŸ’‘ Pro Tip:

    Always test your cron job manually first to ensure the script runs correctly. Add output redirection (>> /path/to/logfile.log 2>&1) to capture errors and debug issues.

    Setting up Cron Job in Plesk

    1. Log in to Plesk
    2. Go to "Websites & Domains"
    3. Click "Scheduled Tasks"
    4. Click "Add Task"
    5. Select task type (Run a command)
    6. Enter command and set schedule
    7. Click "OK"

    Example Command:

    /usr/bin/php /var/www/vhosts/example.com/httpdocs/script.php
    πŸ’‘ Pro Tip:

    Always test your cron job manually first to ensure the script runs correctly. Add output redirection (>> /path/to/logfile.log 2>&1) to capture errors and debug issues.

    Setting up Cron Job in SSH/Terminal

    1. Connect to server via SSH
    2. Run command: crontab -e
    3. Add your cron job line
    4. Save and exit (Ctrl+X, then Y, then Enter)
    5. Verify with: crontab -l

    Example Command:

    */5 * * * * /usr/bin/php /var/www/html/script.php >> /var/log/cron.log 2>&1
    πŸ’‘ Pro Tip:

    Always test your cron job manually first to ensure the script runs correctly. Add output redirection (>> /path/to/logfile.log 2>&1) to capture errors and debug issues.

    πŸ”” Never Let Your Cron Jobs Fail Silently

    You've created a cron job, but how do you know if it's actually running? Most cron failures go unnoticed until it's too late. UptimePro's Heartbeat Monitoring ensures your scheduled tasks execute on time, every time.

    ✨ How Heartbeat Monitoring Works:

    1. Create a heartbeat in UptimePro (get unique URL)
    2. Add one line to your cron script (ping the URL when done)
    3. Get instant alerts if your cron job doesn't execute
    ⏱️
    Know When It Fails

    Get alerts immediately when cron jobs miss their schedule

    πŸ“Š
    Track Execution History

    See detailed logs of every successful execution

    πŸ””
    Multi-Channel Alerts

    Email, SMS, Slack, Discord, Webhook & more

    🎁
    Free Forever Plan

    5 heartbeats included in free account

    Example: Adding Heartbeat to Your Cron

    # Your cron job
    */5 * * * * /usr/bin/php /path/to/script.php

    # With heartbeat monitoring
    */5 * * * * /usr/bin/php /path/to/script.php && curl https://uptimepro.co/api/heartbeat/YOUR-UUID
    Start Monitoring Cron Jobs Free β†’

    No credit card required β€’ 5 heartbeats free forever

    ❓ Cron Job FAQ

    What is cron syntax?

    Cron syntax uses 5 fields: minute (0-59), hour (0-23), day (1-31), month (1-12), and weekday (0-7). Use * for "any value", */n for "every n units", and comma-separated values for specific times.

    How do I test if my cron job is working?

    Run the command manually first to ensure it works. Add output redirection (>> /tmp/cron.log 2>&1) to log output. For reliable monitoring, use UptimePro Heartbeat Monitoring to get alerts when jobs fail.

    Why isn't my cron job running?

    Common issues: Wrong file permissions, incorrect path to script/binary, cron daemon not running, syntax errors in cron expression, missing environment variables. Always use absolute paths in cron commands.

    What's the difference between * and */5?

    * means "every unit" (every minute, every hour, etc.). */5 means "every 5th unit" (every 5 minutes, every 5 hours, etc.). Example: */5 in minute field = runs at :00, :05, :10, :15, etc.

    πŸ’Ό Popular Cron Job Use Cases

    πŸ“§

    Email Reports

    Send automated daily, weekly, or monthly reports to your team

    0 9 * * 1 /usr/bin/php send-report.php

    Every Monday at 9 AM

    πŸ’Ύ

    Database Backups

    Automated database backups to prevent data loss

    0 2 * * * mysqldump -u user db > backup.sql

    Daily at 2 AM

    🧹

    Cleanup Tasks

    Remove old files, clear cache, optimize databases

    0 3 * * * find /tmp -mtime +7 -delete

    Daily at 3 AM

    πŸ”„

    API Sync

    Synchronize data between systems regularly

    */15 * * * * curl https://api.example.com/sync

    Every 15 minutes

    πŸ””

    Health Checks

    Monitor services and send alerts when down

    */5 * * * * /bin/bash health-check.sh

    Every 5 minutes

    πŸ“Š

    Analytics Processing

    Process and aggregate analytics data

    0 1 * * * python3 process-analytics.py

    Daily at 1 AM

    πŸ”” Monitor All Your Cron Jobs

    Get instant alerts when any of these jobs fail. UptimePro Heartbeat Monitoring ensures your automated tasks never fail silently.

    Start Monitoring Free β†’