Course backups not automatically being removed.

Course backups not automatically being removed.

by james mergenthaler -
Number of replies: 7

I am using moodle 2.3.  In my automatic course backup setting,  I set the Keep number to 2.  The text beneath the Keep settings says

"How many recent backups for each course do you want to keep? (older ones will be deleted automatically)"

I interpret this to mean that moodle will automatically delete course backups when new ones are created, in my case once the 3rd backup is created, it will delete the 1st.  I am saving the backup files to a specified location other than the default.

There are currently 7 copies of each course saved.

Am I interpreting this wrong?

Thanks

Average of ratings: -
In reply to james mergenthaler

Re: Course backups not automatically being removed.

by Rick Houghton -

backup_auto_keep is NOT working for me either! In some of my courses I have 100's of backups. I am using Moodle 2.7.1 (Build: 20140714) this is a critical problem for me with no apparent fix in sight.

In reply to james mergenthaler

Re: Course backups not automatically being removed.

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

You might double check that you have permissions set correctly on the folder allowing the apache user (linux) to delete...I have noticed that sometimes if you set the auto delete number after the fact, it will not always delete previously made backups but should work from then on - i.e. You have seven backups already and set it to 2.  Moodle will allow two new backups (totally nine) and then start deleting but the original seven are not always deleted....I think anyway....

In reply to Emma Richardson

Re: Course backups not automatically being removed.

by Paul Lindgreen -
Picture of Particularly helpful Moodlers
My backups are not being deleted either, even though settings are set to only keep 1 copy.

4 of my courses have over 20 backups and are increasing 1 every day. To further complicate things I cannot understand why these 4 backups are occurring to begin with, as they are not being updated.

I'm using moodle 2.7, windows 2008/IIS. The course backups folder has Full Control permissions for the SYSTEM and IUSR user names so I didnt think it was a permissions issue.

Does moodle not recognize the previous backups existence because the date is included in the name, so it appears different each day?
ie backup-moodle2-course-4488-2016wi_busi_3324_01_16_18-20160124-1017
ie backup-moodle2-course-4488-2016wi_busi_3324_01_16_18-20160123-1017
Notice the 23 and 24 for the day of month.

Any suggestions on troubleshooting this, are there some logs I should be reviewing?
In reply to Paul Lindgreen

Re: Course backups not automatically being removed.

by Paul Lindgreen -
Picture of Particularly helpful Moodlers

I forgot to add to the post above, I use 'specified directory for automated backup'.
Its on the same disk drive as moodle but in a seperate folder location.
moodle version 2.7.8

In reply to Paul Lindgreen

Re: Course backups not automatically being removed.

by Paul Lindgreen -
Picture of Particularly helpful Moodlers

I just checked site admin-reports-backups. those 4 courses have Warnings on the main page, when viewing the detailed logs for each course the first line indicates Status OK but further down there's a common error like the following:

Missing file in pool: /ZZZZZ.pdf (context 286117 'File: ZZZZZ', component mod_resource, filearea content, itemid 0) [E:\moodledata\YYYYY/filedir/5b/50/5b5090bb837289dea6a23101b7de34920e772c48]

When I view the course and click the link for the file i get a file not found error and see in the moodledata folder that the file is not there.

Is this a bug with moodle? A missing file causes automated backups to continue daily even when they are unchanged and settings indicate they should only backup when changed. More importantly, these backups are not deleted even when the setting is to only retain 1, this can have disastrous consequences as it will quickly fill up our hard drive and manually monitoring for this problem is not feasible.
In reply to Paul Lindgreen

Re: Course backups not automatically being removed.

by Ken Task -
Picture of Particularly helpful Moodlers

Will backups work *IF* one removes the errant link to  the non-existent file in the course?   Moodle code only doing what it's been told to do ... backup, and include links to resource files (that's taken from meta data in the DB) and place those files in the backup.  

Remove the errant link to non-existent file, then run the backup manually.  Complete without error?

Question might remain, however, why/how was the file removed?  Thought IF there was one course (hidden or active) that linked to a file resource, the file would never been removed.

'spirit of sharing', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Course backups not automatically being removed.

by Paul Lindgreen -
Picture of Particularly helpful Moodlers

I removed the errant link from one course and added a file to the expected file location for another course, both solutions appear to be working.

Makes me nervous knowing a simple missing file can result in a drive space filling up unless I manually monitor it?