automatic file deletion??

automatic file deletion??

by Paul Joyce -
Number of replies: 2

Hi. I'm using Moodle version 3.9.2

I have Moodle hosted on a "Cloud Site" plan. The maximum number of files that I'm allowed to have is 600k.

My file usage had crept up to over 80% of my limit. Just when I was wondering how I would solve this problem, my file usage fell to just over 20%. I didn't delete any files or make any changes that caused this drop. I've not noticed any change in the site since the disappearance and none of the files that disappeared have been missed. So, this was a great turn of events. But I want to understand what happened so I asked the host. The host said, "We would like to inform you, that we have thoroughly reviewed your case, and it seems that Moodle automatically removed the old unnecessary files from the moodledata1 directory."

This has left me puzzled. The only setting within Moodle that I can find for automatic file deletion is "Clean up". I have the settings within "Clean up" on the default settings of: "Clean up temporary data files" set to one week and "Clean up trash pool files" to one day. 

My file usage is still low but is starting to creep up again. So, I'd like to understand how Moodle automatically removes unnecessary files so I can avoid going over the limit. All help much appreciated!

Average of ratings: -
In reply to Paul Joyce

Re: automatic file deletion??

by Ken Task -
Picture of Particularly helpful Moodlers

Much depends on how you've set up moodle.   Example: automated backups, and parameters in course backup defaults (all users, etc.).

Autobackups are part of cron job ... when running, it will use moodledata/temp/backup/ directory to build a backup (.mbz) file and then save that backup to either moodledata/filedir or a designated directory that you create for archiving.

There is an associated 'clean up' cron job/task which cleans up moodledata/temp/backup/ directory.

That's one example ... briefly.

Sites that can setup the recommended run cron once every minute usually don't suffer 'space' or 'inode limits' issues by hosting setup provided those limits are 'reasonable' for a moodle.  Things like your 'Cloud Plan' are not the same across all providers - and in your case, you are not hosted with a Moodle Partner ... not saying you need to, just that your hosting provider doesn't know moodle well and how it works - I say that by what you shared they said. ;)

This sort of thing is in the 'fine print' of 'Cloud Plans' that customers normally don't ask about.

So a bottom line ... make sure your cron job is running correctly and thus 'clean up' task are as well.

'SoS', Ken

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

Re: automatic file deletion??

by Paul Joyce -
Hi Ken,
Thank you very much for your reply. I think that you hit the nail on the head. When I was using a less powerful hosting plan with the provider, the website seemed to be running slowly. They suggested that this was due to the cronjob. So, to avoid my users being impacted, I switched the cronjob to being run every 24 hours. Thanks to your post, I've now gone back to the default of once every minute. Live and learn! Hopefully with my current hosting plan, the site won't be unduly slowed down. Thanks again!