How to I bulk delete Automated backups

Re: How to I bulk delete Automated backups

per Laurent Wafflard -
Nombre de respostes: 7
Imatge Particularly helpful Moodlers

Due to an issue of the external backup space (backup_auto_destination), we also had an explosion of space consumed on moodledata.
The script attached (in french, sorry)  :
    list the automatic backups stored on moodledata
    can copy them elsewhere ("demo" = dry-run, nothing is actually done but it show what would be)
    can delete them (with "demo")

It should be stored at the root of Moodle files (the same level as config.php). Only a Moodle Administrator can call it  (http://moodle_url/purge_autobackup.php)

DATE_BACKUP at beggining of script limit action to a specific date or year.

Hope this help.

En resposta a Laurent Wafflard

Re: How to I bulk delete Automated backups

per Petrus 4 -

Thanks Laurent Wafflard  that was php script worked tres bien!

I recommend it be added to moodle as one of the admin scripts! Somrient


 

En resposta a Laurent Wafflard

Re: How to I bulk delete Automated backups

per Jean Pierre Ducassou -

Awesome job Laurent!

I wanted to run it on console and be able to pass different parameters so I writed a script based on yours.

I hope you don't mind.

It will be on github in case anyone wants to fix or enhance something.

https://github.com/jpducassou/moodle-tool_autobackups

Thanks again to you and all the community.


En resposta a Jean Pierre Ducassou

Re: How to I bulk delete Automated backups

per Laurent Wafflard -
Imatge Particularly helpful Moodlers

Of course no problem for the new version Complicitat Very good idea to make a cli script and even better one to share it !

Thanks for these improvements, we'll try it soon !

En resposta a Jean Pierre Ducassou

Re: How to I bulk delete Automated backups

per Julia Küfner -

Thank you Laurent and Jean Pierre!

Your tool saved me! Successfully deleted 51 GB!

(In my case I had to move to a different server and forgot so set the rights of the backup folder (a non-moodledatafolder on the same server), moodle couldn't access it and started adding backupfiles in filedir without deleting them...) 

here a short info to the script that I "learned" while using it:

-q (query; show the automated backupfiles )
-c (copy; copy files to location)
-d (directory)
-x (expunge; delete automated backupdfiles)

all files are deleted, which means they are send to trashdir (the timestamp of the last emptying of trashdir is set to the past), the next time cron is running tashdir is emptied.