IF you have course backups of all courses, query the mdl_files table for .mbz's and include filename and filesize in output.
There's a plugin ... course size
https://moodle.org/plugins/report_coursesize
OR ... install moosh
It has a switch to the command for 'course-info' which when run on a course id produces info which can be redirected to save to a text file. Note the total file size info (**) in example below and the real size of a backup ... also **
Example output (real course on real server):
moosh -n course-info 3
3 Installing Moodle Solr SLinux 6 or CentOS 6 or CentOS 7 SLCENTOS
Course ID in que: 3
Course ID: 3
No of contexts: 28
Context by level:
CONTEXT_MODULE (70): 23
CONTEXT_BLOCK (80): 5
Context by module:
chat (4): 1
forum (9): 1
label (12): 2
page (15): 8
resource (17): 10
lightboxgallery (23): 1
Number of role capability overwrites: 0
Role capability overwrites by context:
Number of local role assignments: 0
Locally assigned roles by context:
Number of enrolled users: 3
Users enrolled by role:
editingteacher (3): 3
Number of groups: 0
Group statistics:
Min number of members in a group: 0
Max number of members in a group: 0
Avg number of members in a group: 0
Course modinfo size: 48410
Number of sections: 4
Section statistics:
Sections visible: 4
Sections hidden: 0
Min number of modules in a section: 1
Max number of modules in a section: 12
Avg number of modules in a section: 5
Number of grades: 0
Number of log entries: 151
Number of files: 26
Total file size: **1172849**
Cache build time: 0.036876916885376
It also is a little off:
ls -l /home/backup/m32/backup-moodle2-course-3-slcentos-20180521-1738.mbz
-rw-rw-rw-. 1 root root **2348973** May 21 17:38 /home/backup/m32/backup-moodle2-course-3-slcentos-20180521-1738.mbz
But, moosh does give other course info.
'spirit of sharing', Ken