by Ken Task.
At this point, I don't know what to think ... do know there is no recycle bin for deleted courses ... only resources deleted from a course.
Think I'd set recyclebin button/link to display all the time ... normal behavior is to display the link in course admin menu only when there is something in recyclebin. Go to one of these troubled courses and see if there is anything in recyclebin.
The only way to know for sure if files that were linked in a course are used else where in the site is via direct
mysql query of mdl_files table.
And the only way to know for sure if a file is in a backup is to copy the mbz file out to some test area, uncompress it. Then check files.
xml (humanly recognizable name + contenthash value seen) against what one finds in the uncompressed files directory.
The files.xml will show a path to a folder structure like that of moodledata I think 2 levels deep ... for finding using contenthash value seen in files.xml ... 1st two letters/numbers is a subdir in files folder ... 2nd two letters a subdir in the first subdir ... then the file which should be named the same as the contenthash value. Do file -b contenthashfilename to see if it's mimetype.
I do have a 3.9.highest sandbox using auto backups ... no issues .. of which I am aware ... but then again those courses would be small, etc. so ... not fair to compare.
moodledata size increases ... failed backups where those failures are not removed/cleaned up will take up space ... recyclebin files which are stored in the sea of files ... moodledata/filedir/
Query mdl_file table looking for any file using component recyclebin.
Fraid there is no admin tool to sort this out ... just a lot of inspecting various things ... only tool that does come to mind is moosh ... it does have optional commands for finding 'orphaned' files and checking that meta data in mdl_files table matches what can be found in moodledata/filedir/