Tool Spotlight

Crontab Generator - Visual Cron Expression Builder

Build cron expressions visually with real-time preview, natural language explanation, and next run calculator. Perfect for automating server tasks like backups, monitoring, and maintenance on your VPS infrastructure. Schedule SSL certificate checks, automate DNS monitoring, set up email reputation monitoring, or configure port scanning jobs for security audits. Compare performance benchmarks to choose the right server, then optimize PHP-FPM and MySQL/MariaDB settings. Explore our server administration cheatsheets and developer tools for complete automation workflows. Visit our dashboard to track your infrastructure performance or contact us for automation consulting.

Key Features

  • Visual field-by-field builder
  • Real-time expression preview
  • Natural language explanation (EN/ID)
  • Next 10 runs calculator with timezone
  • Favorites with localStorage
  • Validation and warnings

Use Cases

  • Schedule automated backups
  • Set up monitoring jobs
  • Configure cleanup tasks
  • Plan deployment schedules

Validate email addresses in bulk with advanced deliverability checks. Our tool verifies syntax, MX records, SMTP validity, and identifies disposable or role-based accounts. Free for up to 5 emails per validation. After validating your email lists, ensure optimal deliverability by configuring SPF records and DMARC policies. Monitor your sender reputation with our Blacklist Checker and optimize your campaigns with our Email Warmup Schedule Generator.

Crontab Generator

Build cron expressions visually with real-time preview, natural language explanation, and next run calculator. Perfect for scheduling tasks, backups, and automated jobs.

Common Presets

Field Builder

Command Generator

Full path to script or command (e.g., /usr/bin/python3 /home/scripts/backup.py)

* * * * * /path/to/command

📚 How to Add Cron Job to Your VPS

1

Connect to Your VPS

ssh username@your-vps-ip
2

Open Crontab Editor

crontab -e

This opens your crontab file in the default editor (usually nano or vim)

3

Add Your Cron Job

* * * * * /path/to/your/script.sh

Paste the line above at the end of the file

4

Save and Exit

Nano editor: Ctrl + X, then Y, then Enter
Vim editor: :wq then Enter
5

Verify Cron Job

crontab -l

This lists all your active cron jobs to confirm it was added

💡 Tips & Troubleshooting

  • Always use absolute paths for scripts and commands
  • Make sure your script is executable: chmod +x script.sh
  • Test your script manually before adding to cron
  • Redirect output to log file: command >> /var/log/cron.log 2>&1
  • Check cron logs: grep CRON /var/log/syslog

📝 Common Examples

Daily Database Backup at 2 AM
0 2 * * * /usr/bin/mysqldump -u root -p database > /backups/db_$(date +\%Y\%m\%d).sql
Laravel Queue Worker Every 5 Minutes
*/5 * * * * cd /var/www/html && php artisan queue:work --stop-when-empty
Clean Temp Files Every Sunday at 3 AM
0 3 * * 0 find /tmp -type f -mtime +7 -delete

Saved Favorites

Your favorites are stored locally in your browser. They stay private on your device and won't sync across other devices.

Expression

Not validated
* * * * *

Natural Language

Build a valid expression to see description

🧩 Expression Breakdown

Field Value Meaning
1️⃣ Minute * Every minute
2️⃣ Hour * Every hour
3️⃣ Day * Every day
4️⃣ Month * Every month
5️⃣ Weekday * Every day of week
📝
Summary:
Build a valid expression to see the summary

Frequently Asked Questions

What is a cron job and why should I use it?
A cron job is a time-based scheduler in Unix-like operating systems that automatically executes commands or scripts at specified intervals. Use cron jobs to automate repetitive tasks on your VPS server such as database backups, SSL certificate checks, log rotation, server health monitoring, and email reputation monitoring. Track your automated tasks on our dashboard or explore server administration cheatsheets for more automation ideas.
How do I read a cron expression?
A cron expression consists of 5 fields separated by spaces: Minute (0-59), Hour (0-23), Day of Month (1-31), Month (1-12), and Day of Week (0-6, where 0=Sunday). For example: 0 2 * * * runs every day at 2:00 AM, */15 * * * * runs every 15 minutes, and 0 0 * * 0 runs every Sunday at midnight. Use the Expression Breakdown feature in our tool above to see detailed field-by-field explanations.
What does * * * * * mean in cron?
The expression * * * * * means "every minute". Each asterisk (*) represents "every" for that field: every minute, every hour, every day, every month, every day of week. This is the most frequent cron schedule possible in standard cron, executing your command or script 60 times per hour, 24/7.
How do I add a cron job to my VPS server?
To add a cron job: 1) SSH into your VPS server, 2) Run crontab -e to open the cron editor, 3) Add your cron line (e.g., 0 2 * * * /path/to/script.sh), 4) Save and exit (Ctrl+X for nano, :wq for vim), 5) Verify with crontab -l. Check our tool's installation guide above for detailed step-by-step instructions with examples, or visit our Linux command cheatsheets.
Why is my cron job not running?
Common reasons: 1) Incorrect path - Always use absolute paths for scripts and commands, 2) Permissions - Make sure your script is executable (chmod +x script.sh), 3) Environment variables - Cron has limited environment, specify full paths to binaries, 4) Timezone issues - Your server timezone may differ from your local time, 5) Syntax errors - Verify your cron expression is valid using our tool above. Check logs with grep CRON /var/log/syslog for debugging.
What timezone does my cron job use?
Cron jobs run according to your server's system timezone, not your local timezone. The cron expression itself doesn't store timezone information - 0 2 * * * means "2 AM in the server's timezone". Check your server timezone with timedatectl or date +%Z. Our tool shows preview times in your local timezone for reference, but actual execution depends on where your server is located. Compare VPS performance benchmarks across different regions.
Can I run cron jobs more frequently than every minute?
No, standard cron's minimum interval is once per minute (* * * * *). If you need sub-minute execution (e.g., every 30 seconds), consider alternatives: 1) Use systemd timers with OnCalendar settings, 2) Run a long-running daemon script instead, 3) Use a process supervisor like supervisord, 4) Implement a background queue worker. For most server automation tasks like DNS monitoring, once per minute is sufficient.
How do I monitor if my cron jobs are working correctly?
Best practices for monitoring cron jobs: 1) Logging - Redirect output to log files: command >> /var/log/cron.log 2>&1, 2) Email notifications - Cron automatically emails output if MAILTO is set, 3) Health checks - Use services like healthchecks.io or implement custom port monitoring, 4) Dashboard tracking - Log execution times to your monitoring dashboard, 5) Alert systems - Set up alerts for failed executions.
What is the difference between 0 0 * * * and 0 0 * * 1?
The difference is in the last field (day of week): 0 0 * * * runs at midnight every day (all 7 days of the week), while 0 0 * * 1 runs at midnight only on Mondays (1=Monday). Important: If you specify both day-of-month AND day-of-week (and neither is *), the cron runs when EITHER condition matches (OR logic, not AND). For example, 0 0 15 * 1 runs on the 15th of every month OR every Monday.
How do I schedule a cron job for the last day of each month?
Standard cron doesn't have a built-in "last day of month" operator. Workarounds: 1) Check if tomorrow is day 1 - 0 0 * * * [ $(date -d tomorrow +\%d) -eq 1 ] && /path/to/script.sh, 2) Run daily with date check - Let your script check if it's the last day, 3) Use systemd timers - They support more flexible scheduling, 4) Run on 28th-31st with script logic - 0 0 28-31 * * then check in script. For complex schedules, consider exploring modern alternatives in our automation guides.
Should I use cron or systemd timers?
Cron pros: Universal (works on all Unix-like systems), simple syntax, well-documented, easy to understand. Cons: Limited to 1-minute intervals, basic logging. Systemd timers pros: More precise timing (sub-second possible), better logging with journalctl, can specify dependencies, supports calendar expressions. Cons: Linux-specific, more complex setup, requires creating both .timer and .service files. For most VPS server automation (backups, monitoring, cleanup), cron is perfectly adequate. Use systemd timers for complex orchestration or when sub-minute precision is required.
Where can I find my cron job logs?
Cron logs are typically found in: 1) /var/log/syslog (Ubuntu/Debian) - Use grep CRON /var/log/syslog, 2) /var/log/cron (CentOS/RHEL), 3) journalctl -u cron (systemd-based systems). For your script's output logs, redirect stdout/stderr in your crontab entry: 0 2 * * * /path/to/script.sh >> /var/log/myscript.log 2>&1. This logs both normal output and errors. Check our Linux command cheatsheet for more log analysis commands like tail, grep, and awk.