Just an update:
If Moodle can't find these temp files to delete them...then we'll just not do any temp file deleting at all! This is a temporary fix so that we can continue to make our courses while we try to figure out why it can't delete a missing .mbz file.
We commented out the code that deletes temporary files. In /moodle/backup/moodle2/backup_steplib.php, in the class "drop_and_clean_temp_stuff", in the function "define_execution", we modified this:
protected function define_execution() {
global $CFG;
backup_controller_dbops::drop_backup_ids_temp_table($this->get_backupid()); // Drop ids temp table
backup_helper::delete_old_backup_dirs(strtotime('-1 week')); // Delete > 1 week old temp dirs.
// Delete temp dir conditionally:
// 1) If $CFG->keeptempdirectoriesonbackup is not enabled
// 2) If backup temp dir deletion has been marked to be avoided
if (empty($CFG->keeptempdirectoriesonbackup) && !$this->skipcleaningtempdir) {
//$progress = $this->task->get_progress();
//$progress->start_progress('Deleting backup dir');
//backup_helper::delete_backup_dir($this->get_backupid(), $progress); // Empty backup dir
//$progress->end_progress();
}
}
Is it a terrible idea to edit source Moodle code? Definitely! We also need to backup/restore +100 courses within a week for all of the teachers in our school division who are teaching remotely, so we picked the lesser of two evils (yes, facing a teacher's disappointment is the greater evil here).
I'm also thinking that if I cancelled the initial backup job halfway through, there were probably some database entries made in tales that keep track of backups and file hashes and other things lihe that. Are there any SQL tables I could look in to clear out malformed backup-related entries?