-
Bug
-
Resolution: Fixed
-
Minor
-
2.5.5
-
MOODLE_25_STABLE
-
MOODLE_26_STABLE, MOODLE_27_STABLE
-
wip-
MDL-45538-master -
Hi,
I have a concern about the old draft files. I understand from reading the docs and forum posts that the cron should be deleting drafts older than 4 days. Now, we have been looking into the files space usage and found out that we have a bunch of draft files older than 4 days (some going back to 2012) stuck into mdl_files and actually existing on the server in moodledata/filedir. These files can't be seen from Moodle GUI and so, cannot be deleted by users. They weight around 450Mb, which is not much, but I don't like the idea of unused files stacking up in my back.
For example, this video.flv file from mdl_files created on 2013-09-24:
id | contenthash | pathnamehash | contextid | component | filearea | itemid | filepath | filename | userid | filesize | mimetype | status | source | author | license | timecreated | timemodified | sortorder | referencefileid | referencelastsync | referencelifetime |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
77777 | dcb26502c74cbb0efd812be410a2d7149e5e256c | d9597600857b3e80cb1634b03a1a2229bacd6b19 | 100 | user | draft | 360321045 | / | Video.flv | 23 | 189162431 | video/x-flv | 0 | O:8:"stdClass":2:{s:6:"source";s:9:"Video.flv";s:8... | zzz zzzzzz | allrightsreserved | 1380060641 | 1380060646 | 0 | NULL | NULL | NULL |
In the file_storage->cron (/filestorage/file_storage.php), the query didn't retrieve it because of the filename = '.' clause:
$sql = "SELECT *
|
FROM {files}
|
WHERE component = 'user' AND filearea = 'draft' AND filepath = '/' AND filename = '.'
|
AND timecreated < :old";
|
Is something wrong in the cron?
- is a regression caused by
-
MDL-41337 Can't delete the last file from filearea (under some circumstances)
-
- Closed
-