I have a directory for database backups, and a PHP script that makes a backup of the database every day.
But after a month or so i will have 30 files in the backup directory.
How can i write a PHP script that deletes old backup files every day so that there are always 10 backup files in my directory?
when a new backup is stored, the oldest backup file will be deleted and so on …
I have a directory for database backups, and a PHP script that makes a
Share
After making the backup with the PHP backup you loop through the directory and then remove the oldest backup files: