In Moodle 3.9.1 we keep 4 weekly automated course backups in moodledata. However when automated backus runs oldest backups are moved to moodledata/trashdir and it sits there depending on "filescleanupperiod" (Clean up trash pool files) setting.
So if we set filescleanupperiod to 5 days oldest backups are kept in this trashdir for 5 days and only then deleted from server.
In this scenario if have ~3000 course backups weekly, so every weekend we get 3000 new automated course backups and 3000 oldest backups moved to trashdir which gets deleted after 5 days.
So as you can see we need to have a lot extra space, because for few days we actually keep 4 weeks course backups + 1 week oldest backups in trashdir = 5 weeks automated backups.
Even if we would set filescleanupperiod to 1 day (default setting) it wouldn't help, because automated backups are done within ~8-9hours.
Is it possible somehow to automatically delete oldest backups from server without moving to trashdir?
And if it's automatic process why automated backups are moved to trashdir? why they are not deleted from server instantly?
Other solution would be to set filescleanupperiod to like 10minutes, and run "\core\task\file_trash_cleanup_task" like every 30minutes or so?
Because this task runs every 6 hours by default.
Also I am confused about "filescleanupperiod" setting (set for 5 days), is it somehow related to course recycle bin "tool_recyclebin | coursebinexpiry" (set for 3 weeks) ?
For example if teacher deletes some resources from a course, does it moved to trashdir or to other location and only after 3 weeks deleted resource moved to trashdir?