BTC $61,430.00 +0.78% ETH $1,715.93 +0.20% USDT $0.9990 +0.05% BNB $560.58 +0.55% USDC $0.9996 +0.03% XRP $0.9529 +3.63% SOL $72.45 +2.79% TRX $0.3105 +1.97% FIGR_HELOC $1.04 — STETH $1,723.47 +0.11% HYPE $64.29 +3.26% ZEC $785.17 −0.34% XMR $488.41 −0.73% BSC-USD $0.9988 −0.04% BTC $61,430.00 +0.78% ETH $1,715.93 +0.20% USDT $0.9990 +0.05% BNB $560.58 +0.55% USDC $0.9996 +0.03% XRP $0.9529 +3.63% SOL $72.45 +2.79% TRX $0.3105 +1.97% FIGR_HELOC $1.04 — STETH $1,723.47 +0.11% HYPE $64.29 +3.26% ZEC $785.17 −0.34% XMR $488.41 −0.73% BSC-USD $0.9988 −0.04%

Cron Job on the Last Day of the Month

The cron expression 0 0 28-31 * * explained, with the next run times and ready lines for your server.

  • 100% Free
  • No sign-up
  • Runs in your browser
Days

minute · hour · day of month · month · day of week. Also @daily, @hourly, @weekly, @monthly, @yearly, @reboot, and names like MON or JAN.

What does 0 0 28-31 * * mean?

The cron expression 0 0 28-31 * * runs a job on the last day of the month. In plain words: At 00:00 on day 28, 29, 30 and 31 of the month, in the time zone of the server.

Classic cron has no "last day" keyword. The usual trick is to run on days 28 to 31 and let the command check that tomorrow is the 1st: 0 23 28-31 * * [ "$(date -d tomorrow +\%d)" = "01" ] && /path/to/script. The % sign must be written as \% inside crontab.

Need another time? Change the expression in the box above, or pick a different schedule: the meaning, the next run times and the ready lines for cPanel, crontab, systemd, Kubernetes and GitHub Actions update as you type.

Cron on the last day of the month at a glance

0 0 28-31 * *

At 00:00 on day 28, 29, 30 and 31 of the month.

FieldMinuteHourDay of monthMonthDay of week
Value0028-31**
Means0028, 29, 30, 31everyevery

Next runs (UTC)

Times in your own time zone are shown by the tool above.

cPanel › Cron Jobs

MinuteHourDayMonthWeekday
0028-31**

Linux crontab

0 0 28-31 * * /usr/local/bin/php /home/USER/public_html/cron.php >/dev/null 2>&1

systemd timer

[Timer]
OnCalendar=*-*-28,29,30,31 00:00:00
Persistent=true

Variations

  • At 23:00 on days 28 to 31 (with the date check) 0 23 28-31 * *

Related schedules

How to use the Cron Job on the Last Day of the Month

  1. 1

    Check the expression and its meaning above.

  2. 2

    Change the time in the box if you need a different schedule.

  3. 3

    Copy the five cPanel values or the ready line for your system.

Tips for better results

  • Use full paths in the command, such as /usr/local/bin/php, because cron starts with a very short PATH.
  • Send the output to a log file (>> /home/USER/cron.log 2>&1) while testing, then switch to >/dev/null 2>&1 once it works.
  • If one run might still be going when the next one starts, wrap the command in flock -n /tmp/job.lock to skip the overlap.

Your privacy: it stays on your device

  • This tool runs entirely in your browser. What you type and the files you choose are processed on your own device and are never sent to our server.
  • Nothing is uploaded, stored or kept in a history, so it is safe for private text, documents, photos and keys.
  • It keeps working on a slow connection, because no answer has to come back from a server.

Questions people ask

What is the cron expression for on the last day of the month?

0 0 28-31 * * — At 00:00 on day 28, 29, 30 and 31 of the month.

How do I run a cron job on the last day of the month in cPanel?

Open cPanel › Cron Jobs, leave Common Settings on "--" and type the five values 0 · 0 · 28-31 · * · * into Minute, Hour, Day, Month and Weekday. Put your command in Command, for example /usr/local/bin/php /home/USER/public_html/cron.php >/dev/null 2>&1, and press Add New Cron Job.

Can I change the time or start it at another minute?

Yes. For example: at 23:00 on days 28 to 31 (with the date check): 0 23 28-31 * *.

Which time zone does cron use?

The time zone of the server, which is often UTC on hosting and cloud servers. Some cron versions accept CRON_TZ=Africa/Cairo (or another zone) on the line above the job.

FREE BITCOIN TOOLS

Stuck Bitcoin transaction?

Paste your TXID, see where it stands, and give it a free push. No signup, no wallet access.

Try the free accelerator
  • Free
  • No signup
  • Live status