Cron First Day of Every Month

Run a cron job on the 1st of every month with 0 0 1 * * . Monthly report and billing schedule.

The cron expression 0 0 1 * * runs at 00:00 on the 1st of every month. The day-of-month field (1) specifies which calendar days to trigger. This produces 1 execution per month. Monthly schedules are commonly used for billing cycle tasks, subscription renewals, monthly report generation, account statement creation, database archiving, compliance audits, payroll processing, and infrastructure cost reporting. For Quartz Scheduler, use 0 0 1 * ? (swap day-of-month and day-of-week fields, use ? for day-of-week). For AWS EventBridge, use cron(0 0 1 * ? *) (add year field, use ? for day-of-week). For Kubernetes CronJob, use schedule: "0 0 1 * *" directly. Note: months with fewer days than the specified day-of-month will skip that month. For example, day 31 runs only in months with 31 days (7 months out of 12). For the last day of every month, use 0 0 28-31 * * with a script that checks if tomorrow is the 1st. Cron does not natively support "last business day" or "Nth weekday of the month" logic. Implement these rules in your script using date utilities.

FAQ

  • What does the cron expression 0 0 1 * * mean?

    The expression 0 0 1 * * means: at minute 0, hour 0, day-of-month 1, month *, day-of-week *. Each field in the cron expression controls a different time component: minute, hour, day of month, month, and day of week.

  • How do I add 0 0 1 * * to my crontab?

    Run crontab -e in your terminal to open your crontab editor. Add a new line: 0 0 1 * * /path/to/your/script.sh. Save and exit. Verify with crontab -l. Make sure your script is executable (chmod +x script.sh) and uses full paths for all commands.

  • What is the equivalent of 0 0 1 * * on Quartz / AWS / Kubernetes?

    Quartz Scheduler: 0 0 1 * *. AWS EventBridge: cron(0 0 1 * ? *). Kubernetes CronJob: schedule: "0 0 1 * *" (standard 5-field format). Each platform has slight syntax differences — use our dialect switcher above to get the exact expression.

  • What happens when the specified day doesn't exist in a month?

    Cron simply skips that month. For example, day 31 only triggers in months with 31 days (January, March, May, July, August, October, December). February never triggers for days 30-31. Use 0 0 28-31 * * with a script-side check for "last day of month" if you need monthly execution regardless of month length.

  • What are common mistakes when using 0 0 1 * *?

    Common pitfalls: (1) Cron uses a minimal PATH — always use full paths to commands and scripts. (2) Percent signs (%) must be escaped with backslash in crontab. (3) Cron runs in the system timezone — set CRON_TZ=UTC at the top of your crontab for consistent UTC scheduling. (4) Redirect output to prevent email spam: 0 0 1 * * /path/command >> /var/log/myjob.log 2>&1. (5) Test your cron expression with crontab.guru or our validator above before deploying.

Platform Equivalents for 0 0 1 * *

The cron expression 0 0 1 * * has different syntax on various scheduling platforms. Here is the equivalent expression for each:

PlatformExpression
Unix / Linux crontab0 0 1 * *
Quartz Scheduler (Java)0 0 1 * *
AWS EventBridgecron(0 0 1 * ? *)
Kubernetes CronJob0 0 1 * *
Vercel Cron0 0 1 * *
GitHub Actions0 0 1 * * (UTC)

Key differences across platforms: Quartz uses 7 fields starting with seconds and supports L (last) and W (weekday) modifiers. AWS EventBridge requires a 6th year field and uses ? instead of * in day fields when the other day field is specified. Kubernetes uses standard 5-field Unix cron. Vercel Cron uses the same format but schedules are defined in vercel.json. GitHub Actions uses standard cron but runs in UTC timezone only, so adjust the hour field for your local timezone offset.

Getting Started with Cron

Follow these tips when setting up cron jobs in production:

  • Always use full paths to commands and scripts in your crontab, since cron runs with a minimal PATH environment (often just /usr/bin:/bin).
  • Redirect output to log files: command >> /var/log/myjob.log 2>&1 to capture errors and prevent cron from emailing you every execution.
  • Test your cron expression before deploying — use our validator above or crontab.guru to verify the schedule fires when you expect.
  • Set MAILTO="" at the top of your crontab to disable email notifications, or set MAILTO=your@email.com to receive error alerts.
  • Use flock or a PID file to prevent overlapping executions for jobs that may take longer than their scheduled interval.