Run Task On 1st and 15th of Month at 12:30 PM | CronBase

cron expression Standard
$ 30 12 1,15 * *

Twice a month at 12:30 PM on the first and fifteenth days

30
Minute
12
Hour
1,15
Day of Month
*
Month
*
Day of Week

* In a Nutshell

The cron expression 30 12 1,15 * * runs Twice a month at 12:30 PM on the first and fifteenth days. This cadence is critical for financial processes that must occur on specific, predictable days of the month, such as invoice generation or mid-month account reconciliations. Failing to run precisely on these days can lead to missed billing cycles or delayed financial reporting, impacting revenue and compliance.

* When to use this

Use 30 12 1,15 * * when a recurring task needs to run Twice a month at 12:30 PM on the first and fifteenth days. This schedule is commonly associated with financial processing and monthly schedules and report generation workloads. It uses Standard (5-Field POSIX) syntax, supported by Unix cron daemons, cloud schedulers such as AWS EventBridge, and container orchestration platforms such as Kubernetes CronJob.

CronBase parses 30 12 1,15 * * using a dialect-aware rules engine that identifies the Standard (5-Field POSIX) format, validates field structure against the Standard (5-Field POSIX) specification, and produces the translation above. Next run times are calculated by forward-scanning from the current UTC clock. Learn how CronBase works.

Platform Implementations

Bash

Prerequisites

Unix/Linux host with a cron daemon running (vixie-cron, cronie, or systemd-cron). The script at /usr/local/bin/run-task.sh must exist and be executable (chmod +x).

Configuration

Run crontab -e to open the crontab editor. Cron reads the server's local timezone; prefix with CRON_TZ=UTC before the expression to pin to UTC. Always redirect output with >> /var/log/cron-tasks.log 2>&1 to capture both stdout and stderr.

Gotchas

Cron jobs inherit a minimal PATH — use full binary paths or set PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin at the top of the crontab. For sub-hourly schedules, add flock -n /tmp/run-task.lock before the command to skip overlapping runs if the previous execution is still running.

bash
# Add to crontab with: crontab -e
30 12 1,15 * * /usr/local/bin/run-task.sh >> /var/log/cron-tasks.log 2>&1

Last verified:

Nodejs

Prerequisites

Node.js 18+ with node-cron installed (npm install node-cron). Add "type": "module" to package.json to use the import syntax shown above.

Configuration

Pass { timezone: 'UTC' } as the third argument to cron.schedule(). Without this option the schedule uses the Node.js process timezone, which shifts during DST transitions when servers are not pinned to UTC.

Gotchas

node-cron uses standard 5-field cron syntax — not Quartz 6-field. If your job runs longer than the schedule interval the next trigger fires while the previous is still executing. Use a boolean guard or a queue to skip concurrent runs rather than relying on the scheduler to enforce it.

nodejs
import cron from 'node-cron';

cron.schedule('30 12 1,15 * *', async () => {
  console.log('[cron] running at', new Date().toISOString());
  // your task logic here
}, { timezone: 'UTC' });

Last verified:

Python

Prerequisites

Python 3.8+ with apscheduler installed (pip install apscheduler). For Python 3.12+ use apscheduler>=3.10.

Configuration

CronTrigger.from_crontab() accepts a standard 5-field cron string. Always pass timezone='UTC' to both the BlockingScheduler constructor and the trigger to ensure consistent scheduling regardless of the server's locale.

Gotchas

BlockingScheduler.start() blocks the calling thread indefinitely. For a web application, use BackgroundScheduler instead and call scheduler.start() at application startup. APScheduler logs missed fires if the process is stopped and restarted — configure misfire_grace_time (in seconds) to control how late a missed job is allowed to run.

python
from apscheduler.schedulers.blocking import BlockingScheduler
from apscheduler.triggers.cron import CronTrigger

scheduler = BlockingScheduler(timezone='UTC')

@scheduler.scheduled_job(
    CronTrigger.from_crontab('30 12 1,15 * *', timezone='UTC')
)
def run_task() -> None:
    print('task running')
    # your task logic here

scheduler.start()

Last verified:

Golang

Prerequisites

Go 1.18+ and github.com/robfig/cron/v3 (go get github.com/robfig/cron/v3).

Configuration

Always create the scheduler with cron.New(cron.WithLocation(time.UTC)). Without WithLocation, the library defaults to the server's local timezone. Call c.Start() to begin the scheduler, then block with select {} to keep the process alive.

Gotchas

robfig/cron v3 uses standard 5-field cron expressions by default. To add second-level precision (6 fields), pass cron.WithSeconds() to cron.New() — but this changes field positions, so never mix syntaxes in the same scheduler. Always check the error returned by c.AddFunc() — a malformed expression is silently ignored without it.

golang
package main

import (
	"fmt"
	"time"

	"github.com/robfig/cron/v3"
)

func main() {
	c := cron.New(cron.WithLocation(time.UTC))
	_, err := c.AddFunc("30 12 1,15 * *", func() {
		fmt.Println("task running at", time.Now().UTC())
		// your task logic here
	})
	if err != nil {
		panic(err)
	}
	c.Start()
	defer c.Stop()
	select {}
}

Last verified:

Java

Prerequisites

Spring Boot 2.7+ (or Spring Framework 5.3+) with spring-context on the classpath. Annotate your @SpringBootApplication class with @EnableScheduling — without it, @Scheduled methods are silently ignored.

Configuration

Spring @Scheduled uses a 6-field Quartz-style expression: [sec] [min] [hr] [dom] [mon] [dow]. The expression 0 30 12 1,15 * ? is derived from 30 12 1,15 * * — a leading 0 is prepended for the seconds field, and ? replaces the unconstrained day field.

Gotchas

Standard Unix cron has 5 fields; Spring requires 6. Pasting a 5-field expression directly into @Scheduled shifts every field by one and the job misfires silently. Use ? for either dom or dow — Quartz does not allow both to be *.

java
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class ScheduledTask {

    @Scheduled(cron = "0 30 12 1,15 * ?")
    public void runTask() {
        System.out.println("task running at: " + java.time.Instant.now());
        // your task logic here
    }
}

Last verified:

Kubernetes

Prerequisites

Kubernetes 1.21+ (CronJob API is GA). kubectl configured with cluster access. Container image must be pullable from within the cluster.

Configuration

Apply with kubectl apply -f cronjob.yaml. Check status with kubectl get cronjobs and inspect run history with kubectl get jobs. concurrencyPolicy: Allow is set because this schedule fires infrequently — parallel runs are acceptable.

Gotchas

Without startingDeadlineSeconds, a missed job (e.g., due to cluster downtime) triggers as soon as the controller recovers. Kubernetes 1.25+ supports timeZone: UTC in the spec to avoid timezone ambiguity. Keep successfulJobsHistoryLimit and failedJobsHistoryLimit low to avoid accumulating stale Job objects in the cluster.

kubernetes
apiVersion: batch/v1
kind: CronJob
metadata:
  name: scheduled-task
spec:
  schedule: "30 12 1,15 * *"
  concurrencyPolicy: Allow
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: OnFailure
          containers:
          - name: task
            image: alpine:3.19
            command: ["/bin/sh", "-c", "echo 'task running'"]

Last verified:

AWS EventBridge Equivalent

Standard cron expressions often need conversion for AWS EventBridge schedules.

EventBridge Rule
cron(30 12 1,15 * ? *)

Frequently Asked Questions

What does the `30 12 1,15 * *` cron expression specifically do?

This cron expression is configured to trigger an action twice each month. Specifically, it will run at 12:30 PM on the first day of the month and again at 12:30 PM on the fifteenth day of the month. It does not run on any other days.

How does this schedule handle time zones and daylight saving changes?

Cron expressions operate based on the server's local time zone. During daylight saving time transitions, the exact execution time might shift by one hour. It's important to verify the actual execution time after such changes to ensure it aligns with your needs.

How can I verify that this scheduled task is running correctly?

To verify, check your application logs or any monitoring system you have in place. Look for entries corresponding to the expected run times on the first and fifteenth of the month. You can also temporarily add logging to the task itself.

What potential issues might I encounter with this schedule?

A common gotcha is that if a task takes longer than the interval between runs (in this case, roughly two weeks), multiple instances could potentially run concurrently if not managed properly. Ensure your task is idempotent or has proper locking mechanisms.

What is a common variation or alternative to this schedule?

A frequent variation is to run a task once per month on the first day. This would involve adjusting the day-of-month field to only include the first day, ensuring the job reliably triggers at the start of the monthly cycle.

More schedules like this

Explore Financial Processing →

* Try any expression

Standard, Quartz, AWS EventBridge, Jenkins, named schedules (@daily, @hourly…)

* Keep Exploring

Related expressions you might need