Skip to content
Cron Expression Generator

Cron expression for the last day of every month

The cron expression to run a job the last day of every month is:

55 23 28-31 * *

At 11:55 PM, between day 28 and 31 of the month.

Standard crontab has no value for "last day of the month": L is a Quartz extension, and 28-31 on its own would run up to four times in long months. The reliable workaround runs on days 28-31 and lets the shell check whether tomorrow is the 1st: [ "$(date -d tomorrow +\%d)" = "01" ] && command. The backslashes matter, because an unescaped % ends the command in crontab. Running at 23:55 keeps the whole day in end-of-month reports; if the job can process the previous month instead, 5 0 1 * * on the 1st is simpler.

Test and customize this schedule

Format
Valid

5 fields (minute hour day month weekday), or 6 with seconds first. Names like MON-FRI, macros like @daily and full crontab lines work. Press / to focus.

English

At 11:55 PM, between day 28 and 31 of the month.

العربية

في تمام الساعة 11:55 م، من اليوم 28 إلى اليوم 31 من الشهر.

    Quick presets

    Visual cron generator

    Pick options for each field — the expression above updates instantly.

    Next 5 executions

    Local time:

      Cheat sheet

      *
      Any value
      ,
      List — 1,15,30
      -
      Range — 1-5
      /
      Step — */10
      ?
      No specific value (day fields)
      @daily
      Macro for 0 0 * * *

      Field-by-field breakdown

      FieldValueMeaning
      Minute5555
      Hour2323
      Day of month28-3128 through 31
      Month*Every month
      Day of week*Every day of the week

      Copy-paste examples

      Linux crontab

      # crontab -e
      # runs on days 28-31, but the command only fires when tomorrow is the 1st
      55 23 28-31 * * [ "$(date -d tomorrow +\%d)" = "01" ] && /usr/local/bin/my-job.sh >> /var/log/my-job.log 2>&1

      Kubernetes CronJob

      apiVersion: batch/v1
      kind: CronJob
      metadata:
        name: my-job
      spec:
        schedule: "55 23 28-31 * *"
        concurrencyPolicy: Forbid
        jobTemplate:
          spec:
            template:
              spec:
                restartPolicy: OnFailure
                containers:
                  - name: my-job
                    image: busybox:1.36
                    command: ["sh", "-c", "date; echo Hello from cron"]

      GitHub Actions

      on:
        schedule:
          - cron: '55 23 28-31 * *'   # always UTC

      GitHub Actions evaluates schedules in UTC, does not accept macros such as @daily, and will not run workflows more often than every 5 minutes; runs can also be delayed during periods of high load.

      Common variations

      Click an expression to load it into the tool above.

      Cron expressionSchedule
      At 10:00 PM, between day 28 and 31 of the month.
      At 12:05 AM, on day 1 of the month.
      At 11:55 PM, between day 28 and 31 of the month, only in March, June, September, and December.
      At 12:00 AM, between day 28 and 31 of the month.

      Frequently asked questions

      What does 55 23 28-31 * * mean in cron?

      At 11:55 PM, between day 28 and 31 of the month. The five fields are minute 55, hour 23, day of month 28-31, month * and day of week *.

      How do I run a cron job the last day of every month in Linux?

      Run crontab -e, add the lines from the Linux crontab example on this page, then save and exit. Use absolute paths, redirect output to a log file, and confirm it runs with grep CRON /var/log/syslog.

      When will 55 23 28-31 * * run next?

      It depends on the current time and the time zone of the machine running cron. The calculator on this page shows the next 5 run times in your local time zone; on a server, cron uses the system time zone, which is often UTC.

      How do I run a job on the last day of the month in Kubernetes or GitHub Actions?

      Both accept only standard cron syntax, so schedule the job on days 28-31 and make its first step the same check: [ "$(date -d tomorrow +%d)" = "01" ] || exit 0. Inside a script or YAML file % needs no escaping, and on macOS or BSD use date -v+1d +%d instead. Scheduled GitHub Actions runs can start late, and a 23:55 run that begins after midnight fails the check, so pick an earlier time there, such as 0 22 28-31 * *.

      Related cron schedules

      Browse all cron expression examples →