I'm after a script (shell or Perl) that can be run on cron each day that will perform at least the following:

- go through and put a MySql dump of each database in a specified folder
- the filename of each dump must be the same as the actual database name
- it must automatically overwrite any previous dumps of the same name

It would be wonderful if it did this too:

- somehow check and only backup the MySQL database if it has been modified in the last 24 hours (if so do a dump and overwrite the previous backup, if not move onto the next DB).

Does anyone know of such a thing or something close?