10.27.2006

cron - run command last day of month

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=123030&admit=-682735245+1161911384666+28353475
Solves the problem of running a script on the last day of the month. Put 28-31 (for days) in your crontab and put this little section in for date determination.

#!/bin/sh

if test `TZ=MET-24 date +%d` = 01
then
exec command
else
exit 1
fi

No comments: