script needed urgent

Lot of dump files are created and filling up our file system.
( i.e. /Aix/app/clone1/heapdump659904.1188950424.txt, Aix/app/clone2/heapdump87878.88798.txt) . We got an alert that the filesystem was full and saw there were heapdumps from a few months ago that we didn't know about. It would be good if we could setup a job to scan these app directories nightly and send an email when a heapdump is created.

our directory structure is like this
Aix/app/clone1/heap************
Aix/app/clone2/heap************

  i need a script which scan this directory and send me the mail regarding the heapdump file created.

I can make it in cron job and xecute it daily.

please help me on this

ls -la Aix/app/clone*/heap*
if $? = 0; then mail -s "found heap" mail@you.org
else mail -s "no heaps" mail@you.org; fi 

Logic of that sort, if there isn't such file, matching the pattern, the return code will be "2"

if you remove heap files every day just ;
find /aix/app -name heap'*' >out.log you must use single quote with *

if you don't remove files you must find a way to find which added.

belove code is todays heaps

md=`date`
mount=`echo $md |awk '{print $2}'`
day=`echo $md |awk '{print $3}'`
find /aix/app -name heap'*' -exec ls -l {} \; |awk -v p1=$mount -v p2=$day ' ( $6 == p1 ) && ( $7 == p2 ) {print $9 }' >out.log

if you run above code before 23:59 every day it writes that days heapfiles to logfile