-
Improvement
-
Resolution: Fixed
-
Minor
-
2.2.1, 2.6.4
-
MOODLE_22_STABLE, MOODLE_26_STABLE
-
MOODLE_29_STABLE
-
wip-
MDL-32547-master-v2 -
-
-
BACKEND Sprint 18
If backup tries to backup a large course and the backup fails to complete successfully a large amount of disk can be taken up in moodledata/temp/backup. Further attemps to complete the same course backups will not reuse the temp directory contents or clean out old contents but instead start again.
This can cause disk space usage to grow to hit limit imposed by host or disk capacity with little or no notification to site admin or entry in server logs. Site functionality could also be affected if no space available for new courses/resources to be added. Unknowningly users with backup permissions could crash site by repeating command to backup large course and fill allocated disk space with incomplete course backups
A side affect of this is non-moodle based backups of db and files take longer because contents of tempdir is larger than necessary
To reproduce:
Attempt to backup a large course either manually from backup UI or via automated backups configured via UL. Monitor the moodledata/filedir/temp/backup When the backup fails due to timeout of apache or php (e.g html error 500) the contents will remain along with an blank .log file with the same name as the temp folder which was created, in my case just under 10GB for 1 course
rerun the backup again and a new folder will be created in the temp directory but without cleaning up the 1st attempt
Possible Cures:
1) Log start time of backup in logs, with progress updates entered and if backup is not completed in X hours delete the contents of temp\backup folder and notify admin. This would also help admins know how far backups get before they fail.
2) Allow site admin/backup user to see list of tempdir on backup screen and clear as needed
3) Possibly wider benefit from this but allow site admin to list temp dir size and contents and set "time to live" value for contents before cleaned up by cron process
4) Emergency Option if files.api reports problems writing to disk due to insufficient space prompt admin to empty tempdir so users not affected.
5) Impose quota on tempdir size set by site admin and include checking in cron process to warn admin if quota is neared
- has a non-specific relationship to
-
MDL-27790 Temporary course remains after restore
- Closed
-
MDL-1520 If scheduled backup fails, temp dir grows without limit...
- Closed
- has been marked as being related by
-
MDL-38189 META Backup/restore issues with large courses
- Closed
-
MDL-33752 When trying to import content from one course to another, the backup/import.php script results in a HTTP 500 error.
- Closed
- is blocked by
-
MDL-48252 file_temp_cleanup_task only does a partial delete.
- Closed