β° 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
π Advanced Features
β‘ Popular Cron Examples
π How to Set Up Cron Jobs
Setting up Cron Job in cPanel
- Log in to your cPanel account
- Navigate to "Advanced" section
- Click on "Cron Jobs"
- Select cron timing or use custom expression
- Enter the command to run
- Click "Add New Cron Job"
Example Command:
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
- Log in to DirectAdmin
- Go to "Advanced Features"
- Click "Cronjobs"
- Click "Create New Cronjob"
- Enter cron expression (minute, hour, day, month, weekday)
- Enter command to execute
- Click "Create"
Example Command:
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
- Log in to Plesk
- Go to "Websites & Domains"
- Click "Scheduled Tasks"
- Click "Add Task"
- Select task type (Run a command)
- Enter command and set schedule
- Click "OK"
Example Command:
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
- Connect to server via SSH
- Run command: crontab -e
- Add your cron job line
- Save and exit (Ctrl+X, then Y, then Enter)
- Verify with: crontab -l
Example Command:
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:
- Create a heartbeat in UptimePro (get unique URL)
- Add one line to your cron script (ping the URL when done)
- Get instant alerts if your cron job doesn't execute
Get alerts immediately when cron jobs miss their schedule
See detailed logs of every successful execution
Email, SMS, Slack, Discord, Webhook & more
5 heartbeats included in free account
Example: Adding Heartbeat to Your Cron
*/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
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
Every Monday at 9 AM
Database Backups
Automated database backups to prevent data loss
Daily at 2 AM
Cleanup Tasks
Remove old files, clear cache, optimize databases
Daily at 3 AM
API Sync
Synchronize data between systems regularly
Every 15 minutes
Health Checks
Monitor services and send alerts when down
Every 5 minutes
Analytics Processing
Process and aggregate analytics data
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 β