My Friends
I want to run a script only at the end of month.but i tried below cront entry its not working. pls help
0 9 28-31 [[ "$(TZ="GMT-$((24*1))" date +\%d)" == "01" ]] && /usr/bin/bash /u01/app/scripts/CX-eom.sh
Os Details: AIX 7.1.0.0
My Friends
I want to run a script only at the end of month.but i tried below cront entry its not working. pls help
0 9 28-31 [[ "$(TZ="GMT-$((24*1))" date +\%d)" == "01" ]] && /usr/bin/bash /u01/app/scripts/CX-eom.sh
Os Details: AIX 7.1.0.0
WHAT is "not working"? Any error message? Are you aware that the month and day-of-week date fields are missing in above crontab entry?
And, isn't $((24*1))
an overcomplicated way to express 24
?
Hi Rudi
Thanks Months need to add like 1-12 , issue is The process was run every day not on the end of the month.
any improvements?
Any errors?
Hi,
You could try;
* 9 28-31 * * [ $(date -d +1day +\%d) -eq 1 ] && /usr/bin/bash /u01/app/scripts/CX-eom.sh
Depends how clever the version of date
is.
Regards
Gull04
Thanks Guyz