Rotating backups
Posted by: haggis
Posted on: 2005-08-09 12:23:00
Say I have a cron job that regularly dumps a few mysql databases into a backup directory, with the date suffixed, like so
mydatabase_08-06-2005.sql
myotherdatabase_08-06-2005.sql
mydatabase_08-07-2005.sql
myotherdatabase_08-07-2005.sql
mydatabase_08-08-2005.sql
myotherdatabase_08-08-2005.sql
... and so on ...
Is there a (very) simple way to automatically limit the number of dumps in that directory, for instance, to the ten freshest? I could save the dumps with the date-stamp as a prefix if it would help.