How to delete automated course backup files moodle 2

How to delete automated course backup files moodle 2

by Susana L. -
Number of replies: 16

Hi,

Because of some permission problem (I think...) automated backups were not saved on the specified location, but were saved along with course files... The setting specified to keep only 2 files didn't take any effect and the server disk space started to increase with the amount of backups...

Now I want to delete those backups files! How do I do that?

If I go to filepicker I can see a folder named "Automated backups" with backup files... Going to moodledata/filedir folder I can understand they are there... What's the best procedure to delete them all?

Thank you,
susana

Moodle2.1->2.2

Average of ratings: -
In reply to Susana L.

Re: How to delete automated course backup files moodle 2

by Susana L. -

Please, does anyone know how to bulk delete the backup files?
Thanks,
susana

In reply to Susana L.

Re: How to delete automated course backup files moodle 2

by Rosario Carcò -

This depends on your Operating System. In Linux you could write a bash-script to do it or combine some command-line commands like

find -type f -name backup_*.zip -exec rm {} \;

PLEASE DO NOT execute such a command without verifying/thinking about what you are going to do. I am no linux expert and you might lose all of your files.

You might search first for solutions on the internet suited for your Operating System on how to bulk erase a bunch of files.

Rosario

In reply to Rosario Carcò

Re: How to delete automated course backup files moodle 2

by Susana L. -

Hi,
Please correct me if I'm wrong... but there are no .zip files on Moodle 2.
Thanks,
susana
 

In reply to Susana L.

Re: How to delete automated course backup files moodle 2

by Susana L. -

Does anyone know if there is a better solution than go to each course, choose Restore Backup (Is this also the only path to manually manage backups???), and then choose Manage backups and manually delete them, one by one.

Thanks,
susana
 

In reply to Susana L.

Re: How to delete automated course backup files moodle 2

by Susana L. -

I did manually delete the course backup files from one of the courses, but the files were not deleted. After deleting them one by one, I visited the manage backups page again (Course Administration>Restore>(AUTOMATED BACKUPS)Manage backup files) and they were all listed there...
Can anyone replicate this issue?
Moodle 2.2.1+ (Build: 20120217) 

In reply to Susana L.

Re: How to delete automated course backup files moodle 2

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Hi Susana, there seems to be a number of issues around this lately, but here is one discussion that might be helpful http://moodle.org/mod/forum/discuss.php?d=191275

Koen had this problem and it sounds similar to yours.

Average of ratings: Useful (1)
In reply to Colin Fraser

Re: How to delete automated course backup files moodle 2

by Susana L. -

Thank you Colin. Yes, it is similar. This lack of control through file system is making me crazy!!... But I'm sure there are advantages, but there are just some issues to refine.

About the files being not deleted through Moodle interface... I guess I missed the save button on the page bottom... I'm not sure if I was just too tired or if there is some usability issue... maybe both.

Thanks,
susana 

In reply to Susana L.

Re: How to delete automated course backup files moodle 2

by Paul Vaughan -

I just spent most of the afternoon manually deleting automatic course backups. I'm a little surprised there isn't a 'select all' option and delete button (wait for it) like the Moodle 1.9 file picker! The files are only there due to a bug but it's difficult to rectify adequately.

In reply to Susana L.

Re: How to delete automated course backup files moodle 2

by Jennie Lillis -

I'm working with this issue at the moment (in 2.0.3) and have successfully deleted backup files from the largets of our courses in the way Susana suggests (you do need to hit the 'Save' button to complete the operation...I learned that the hard way too!).  Also, the server space will not be freed immediately as the deleted files are moved to a deleted folder which is cleared by a Cron job overnight.  Therefore you should see some movement on the space available on your disk the next day.

I would certainly vote for development of a way for admins to manage files more effectively through the front end.  I think this should include the ability to view all (backup) files on the Moodle by size, regardless of what course they relate to (or even just to be able to view the courses by size so the large ones can be spotted easily).

I'll watch this issue with interest...

Jennie

In reply to Susana L.

Re: How to delete automated course backup files moodle 2

by Rosario Carcò -

I am sorry for the delay. The new File format is *.mbz

We should add our complaints to the general forum where the new file system is discussed and where I already told why I do not like it from an administrator's point of view:

http://moodle.org/mod/forum/discuss.php?d=174702

Maybe we have to select the backups to be stored in one common area to be able to deal with bulk operations on them (see Site-admin->Courses->Backups->Automated Backup Setup->Path to store). The new problem is that Moodle now tracks every file and you have to go through its GUI to give the database to follow your operations on files. And deleting, as has already ben said, now takes two steps through the "wastebasket" which is emptied by a cron job. A lot of hassle. This will create headaches if Moodle does not correctly rotate its own backup-zip-files and your data disk gets filled up over nigth. I experienced this more than once in the last years, and again two or three weeks ago. With my Moodle 1.9 I can simply search and delete those files and free up the data disk immediately. But you can not do it in Moodle 2.x

Rosario

In reply to Rosario Carcò

Re: How to delete automated course backup files moodle 2

by Ken Task -
Picture of Particularly helpful Moodlers

In 2.2.x of Moodle one could chose to use (exclusively) the external directory for automated backups - specified directory option.  If that folder is a mount point to another server/device - like a NAS or mass storage USB/Firewire device - then none of the backups should reside in the DB.  Or am I not understanding how that works?

From time to time a human might have to archive the backup server/device to other media.

Of course there is the issue of the server/device running out of space as well and have already experienced that with a 1.9.x no less.

'spirit of sharing', Ken

In reply to Ken Task

Re: How to delete automated course backup files moodle 2

by Rosario Carcò -

IMHO, if the new file system is consistent, even putting a path to any storage in the mentioned backup-path does not mean that the backup-zip-files are not tracked in Moodle's database. You still can see those files and you still can delete/rename/move/restore them through the GUI. But we would have to checkin the docs or make some tests to be sure.

Rosario

In reply to Rosario Carcò

Re: How to delete automated course backup files moodle 2

by Mike Sangray -

I'm dealing with this issue now. Is there still no file management for deleting automated backup files?

Also, I've reconfigured my backups to go to a target folder. This works fine, however, the option to keep only 1 recent file is not working, all backup files are being kept. I'll have to write a cron job to delete the files myself.

Mike

In reply to Mike Sangray

Re: How to delete automated course backup files moodle 2

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

This has been fixed in a recent release.  The best solution would be to upgrade to the latest release.  I was having this issue too and am so glad that it is resolved now!

In reply to Emma Richardson

Re: How to delete automated course backup files moodle 2

by Mike Sangray -

Which issue has been fixed (or both)?

No file manager for deleting automated backup files?

Automated backups not deleting older copies when stored in a target folder?

Mike

In reply to Mike Sangray

Re: How to delete automated course backup files moodle 2

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

The automated system now deletes the older copies stored in a target folder.