Use a date math trick in a shell script that I named 'last-day-of-month.sh'. The script will exit with a 'success' (zero) status only if today is the last day of the month. On any other day, it will exit with an 'error' status (one).
#!/bin/bash TODAY=`/bin/date +%d` TOMORROW=`/bin/date +%d -d "1 day"` # See if tomorrow's day is less than today's if [ $TOMORROW -lt $TODAY ]; then exit 0 fi exit 1Which can then be used within a crontab file as follows:12 0 * * * /usr/local/bin/last-day-of-month.sh && /run/my/cron/job.sh