If you mean different servers, then creating a cronjob on each is the best thing to write. Write a common script which does useful housekeeping, and schedule it on all the servers.
If you mean different locations on the same server, then one cronjob that reads directories from a text file and cleans them is the simplest option, mysql seems overkill for a list of target directories. If there is a good reason for having the locations in a mysql database, then you could write a single perl script to read the mysql data and tidy up the directories listed.
Lastly, depending on how your web applications create the files, they should be written to housekeep them themselves anyway. When the application creates a new cached file, it could check to see if it needs to remove any. Self managing applications are better than relying on external scripts which can fail for unrelated reasons.