diff --git a/admin/cli/restore_backup.php b/admin/cli/restore_backup.php index 597c85f5dac..2ee45af2d9a 100644 --- a/admin/cli/restore_backup.php +++ b/admin/cli/restore_backup.php @@ -92,8 +92,8 @@ if ($options['categoryid']) { throw new \moodle_exception('invalidoption'); } -$backupdir = "restore_" . uniqid(); -$path = $CFG->tempdir . DIRECTORY_SEPARATOR . "backup" . DIRECTORY_SEPARATOR . $backupdir; +$backupdir = restore_controller::get_tempdir_name(SITEID, $USER->id); +$path = make_backup_temp_directory($backupdir); cli_heading(get_string('extractingbackupfileto', 'backup', $path)); $fp = get_file_packer('application/vnd.moodle.backup');