Script for deleting 30 days older

Hi,

I need a script to delete files that are 30 days older and also the file name should contain aa or ab or ac as substring...

Regards,
Dolly....

find /someDirectory -type f -name *aa* -atime +30 -exec rm {} \;

Hey sorry to bother....

Im new to scripting........

wts the function of "-atime" ?

can we use or condition in Scripts bcos i need to delete a filename which could either contain aa or ab or ac as substring.......

Thanx a lot....

Read man find to find out all about -atime and its friends.
To match aa, ab or ac sunstrings in the filename, use a regexp like

find . -name "*a[abc]*

The bit in brackets means "match any of these characters".