housekeeping

hey, I have to write a housekeeping script which would delete any files which are more than 10 days old, the file is named in such a fashion

MYTEST20060101_182239.txt
MYXML20060112_182879.xml
MYEXCEL20060113_546321.xls

If the current date is 20060112, then MYTEST20060101_182239.txt will be removed. Would anyone show me how? thanks

Try something like this:

find /path/to/files -name \*`date +%Y%m%d`\*  -exec rm {} \;

TEST this first before you run it. It's looking for files that match :*20060428*
for today, April 28, 2006, for example.

instead of using find (mtime which may be changed), is there any other way by simply use the timestamp within the filename? Thanks!