Reports: Course size

Maintained by Picture of Dan MarsdenDan Marsden, Picture of Peter BulmerPeter Bulmer, Picture of Catalyst ITCatalyst IT
This plugin provides approximate disk usage by Moodle courses.
4234 sites
68 fans
Current versions available: 6

This plugin provides approximate disk usage by Moodle courses.

There are 2 known shortcomings with this plugin

  • If the same file is used multiple times within a course, the report will report an inflated disk usage figure as the files will be counted each time even though Moodle only stores one copy of the file on disk.
  • If the same file is used within multiple courses it will be counted in each course and there is no indicator within the report to inform the user if they delete the course or files within the course they will not free that amount from disk.

It should be possible to improve the report to address these issues - we'd greatly appreciate any patches to improve the plugin!

To improve the performance of the total disk usage check, you should configure the pathtodu in your installation:


Screenshot #0


Picture of Dan Marsden
Dan Marsden (Lead maintainer)
Picture of Peter Bulmer
Peter Bulmer: Developer
Please login to view contributors details and/or to contact them

Comments RSS


  • Germán and Temudgin
    Tue, Sep 23, 2014, 11:36 PM
    Congratulations to the authors of this useful plugin.

    I have tried it in my University site and it is very convenient. I already translated it into Mexican Spanish in AMOS smile

    One minor issue, the final table shown for the top 10 users seems to have a hard-coded English language string for 'Disk Usage'. It would be better for the translators if this string were declared as a variable, available for translation in AMOS.
  • Picture of Dan Marsden
    Wed, Sep 24, 2014, 8:09 AM
    Thanks Anthony and thanks German,

    German - I've pushed a fix through for that issue, the string was already in the language pack but was hard-coded in the code. I've updated the version here in the plugins db but haven't incremented the version numbers. We have some internal issues with our own use of this plugin and if I bounce the version number and we update our internally hosted sites we'll have some problems! smile

    Should have those sorted soon.
  • Just wondering . . .
    Fri, Oct 17, 2014, 9:30 AM
    Two questions:

    How is the site data calculated? (I presume it is the size of the Moodledata database?)
    How is the individual usage calculated? What is it made up of? - I presume backups + Private files?

  • Picture of Dan Marsden
    Fri, Oct 17, 2014, 9:45 AM
    HI Derek,
    site data is calculated by the physical size used on the server inside the whole "moodledata" directory - it does a file system check to obtain this and doesn't use/look at the moodle database, so this will include all files uploaded directly to the server into the moodledata directory including things like file system repositories or custom added files.

    Individual user usage contains all files linked to a user context - which I think is only really the private files area but I haven't checked to see if there are other ways of storing data at the user context other than private files.
  • Picture of Arto Nieminen
    Thu, Nov 20, 2014, 11:55 PM
    I noticed that Manager role users cannot access the report. Capability 'report/coursesize:view' is allowed for default Manager role, but there is no required capability set for the Site administration link.
  • Picture of Dan Marsden
    Fri, Nov 21, 2014, 4:23 AM
    Thanks for the report, I've added a check for the capability on the settings page and pushed that fix into the github repo.
  • Picture of Marie CICHOCKI
    Mon, Apr 27, 2015, 3:59 PM
    Hello, is this pluggin compatible with Moodle 2.8.1 ? Thanks!
  • Picture of Dan Marsden
    Tue, Apr 28, 2015, 6:44 AM
    yes - I just updated the supported versions, Thanks.
  • Just wondering . . .
    Sun, Dec 13, 2015, 4:30 PM
    Dan, I asked this last year: How is the individual usage calculated? What is it made up of? - I presume backups + Private files?

    You said "Private Files" (etc) . . .

    I have less than 5 Meg in my private files.
    But it says 1.6 GIG in your course size report.

    Any suggestions on anything I can look at to figure this out?

  • Picture of Peter Bulmer
    Mon, Dec 14, 2015, 4:57 AM
    When I was looking into this some time ago, Moodle had a concept of deleted files. Files would get marked as deleted when no-longer needed, and actually deleted a few days later if nobody manually undeleted them. The deleted files were being stored against the name of the person who deleted them for this short time between being marked as deleted, and being actually deleted. I never did figure out if there was a way for end users to undelete the files if they saw the error of their ways.

    Is it possible this is what you're seeing? Did you delete about 1.6GB of data before running the report?
  • Just wondering . . .
    Mon, Dec 14, 2015, 4:50 PM
    I'm not sure. I would have put my deletions at less than 400Meg.
    So as an experiment I went in today and deleted a bunch of backup files, around 400Meg. The amount reported by your report rose by a Gig or so.
    Maybe there is someway it is being counted twice.
    I'll now wait a few days until all the deletions are done by the trash collection and see what happens.
    I have not solved the problem, just postponed any more thinking about it.

    Thanks for the reply Peter.
  • Ricardo Caiado
    Wed, Dec 7, 2016, 8:51 PM
    Any upgrade to Moodle 3.2?
  • Picture of Dan Marsden
    Thu, Dec 8, 2016, 3:56 AM
    I don't think anyone here has tested it properly on 3.2 yet, but the existing version will probably still work - let us know if there are any issues by adding a new issue in the github tracker.
  • Picture of Virgil Ashruf
    Thu, Jan 5, 2017, 7:21 PM
    This plugin seems to be failing a lot with us lately with the maximum execution time being reached and the script halting. Especially in very large sites (20GB+ on disk and millions of records in the files table). The source does not give away that the disk is being checked, rather it's an elusive join that I think it's failing on.

    What is the proper setup to get this working properly? Do you think a scheduled task might be in order?
  • Picture of Dan Marsden
    Fri, Jan 6, 2017, 4:51 AM
    do you have the path to du set in your installation?
Please login to post comments