Cleaning up moodledata (18GB)

Cleaning up moodledata (18GB)

by Prashad Wang -
Number of replies: 2

Hi there,

My moodledata directory is 18GB and I'm running up against the storage limits on my web server. It's virtually all in the filedir/ directory.

I'd like to see if I can save some space. Are there methods for me to browse these files so I can clean them up?

Thanks,
Prashad

Average of ratings: -
In reply to Prashad Wang

Re: Cleaning up moodledata (18GB)

by Colin Fraser -
Picture of Documentation writers Picture of Testers

When you deprecate a course, the files associated with that course should be deleted as well.

Check to see where backups are being stored, or how they are being stored. Can you download and delete older or duplicated backups? I suspect this is an area that is often neglected by Admins and that can cause some heartburn. 

In reply to Prashad Wang

Re: Cleaning up moodledata (18GB)

by Ken Task -
Picture of Particularly helpful Moodlers

Filedir of Moodledata isn't really 'browsable' where one could see humanly recognized file names.   There might be a plugin, that will help a little, but probably not as much as you'd like.

Really getting to 'see' what's in there involves a DB query of mdl_files for contenthash, filename, filesize, component to get the meta data.   Just because there's a reference in DB, however, doesn't mean there are not orphaned files.

Might help some:

https://moodle.org/plugins/report_filetrash

Also a command line tool called 'moosh'.

https://moosh-online.com/

Look at commands:

https://moosh-online.com/commands/

and you'll see quite a few related.

Running your cron frequent enough?   One task of the main cron is to empty the trashdir in moodle data.   Files might get placed in trashdir from filedir when courses are deleted (if no other courses link to those flies), when students are removed, etc.

Are you running autobackups?

'spirit of sharing', Ken