I use the linux 'find' utility with cron to filter emwin texts and graphics files. The process is pretty straightforwrard, here is what I do...
1) Create a ramdisk with sufficient space to store the emwin files you want to save. There are many ways to create a ramdisk and I won't go into that here. Google is your friend on this one. I have my ramdisk mounted at /media/ramdisk.
The reason to store emwin files in a ramdisk is to save wear and tear on your physical disks - emwin generates lots of data and this process saves everything from goestools, and then deletes it selectively based on time since the file was written and filename. In my case, I need about 105 MB of space in my ramdisk for the emwin files.
2) Use goestools to dump all emwin files (including text messages to e.g. the /media/ramdisk/emwin directory). Carl has good information about how to do this on his web page referenced above.
3) Then I run the following commands from cron:
1 */3 * * * /usr/bin/find /media/ramdisk/emwin -name "*" -type f -mmin +720 -delete
*/5 * * * * /usr/bin/find /media/ramdisk/emwin/*.TXT -type f ! -name '*KDVN*' ! -name '*KBOU*' -print -delete
The first line runs every three hours at 1 minute past the hour, and deletes all files in the /media/ramdisk/emwin directory older than 720 minutes (6 hours). The second line runs every five minutes and deletes all files ending in .TXT that do not contain KDVN or KBOU (the two areas I am interested in). If you want to delete files containing a particular text string (rather than delete everything but files containing the text string), omit the exclamation mark before the -name flag in the command. You can handle multiple text strings with the same command, or write one command for each text string you want to handle.