cron job

how do you schedule a job to run at the last day of the in a single crontab line

for example if I put a crontab entry of

0 0 31 * * /path_of_my_script

the above will only run if the last day of the months is 31, what happens if the last day of the month is 28 or 30.

if I put a crontab entry of

0 0 28,30,31 * * /path_of_my_script

this will run on all three days 28, 30, and 31

But I only want my script to run on the last day of the month
Is they a way to have a cron job run at the last day of the month regardless if the last day of the month is 28, 30, or 31?

Thanks in Advance

You have to add some logic to your script to see what the day and month is....and then you would have to figure out if it's a leap year (Feb 29)!

There are some tips on the Net ( like this one ).

if you know the month just schedule it... IF this is to run every month, you will need a script that has logic in it...

I will post here a script I found that works.

A user here came up a simple solution. She puts in 12 entries, one for each month of the year. I pointed out that the February entry will be wrong in leap years. She just shrugged and said she reviews her cron jobs in late December anyway.

Thanks everyone.

RTM tips works