backup-manager / laravel

Driver to seamlessly integrate the Backup Manager into Laravel applications.
MIT License
655 stars 149 forks source link

How to delete a backup #124

Open zilzilonline opened 4 years ago

zilzilonline commented 4 years ago

I scheduled to backup every midnight. I would like to keep only 3 latest backups in my dropbox. So how can i delete old copies?

robbielove commented 3 years ago
//write some code to check that more than 3 backups exist
if (Storage::delete($path)) {
echo "deleted";
}

https://laravel.com/docs/8.x/filesystem#retrieving-files https://laravel.com/docs/8.x/filesystem#directories