static public function delete_old_backup_dirs($deletefrom, \core\progress\base $progress = null) {
        $status = true;
        // Get files and directories in the backup temp dir without descend.
        $backuptempdir = make_backup_temp_directory('');
        $list = get_directory_list($backuptempdir, '', false, true, true);
        foreach ($list as $file) {
            $file_path = $backuptempdir . '/' . $file;
            $moddate = filemtime($file_path);
            if ($status && $moddate < $deletefrom) {
                //If directory, recurse
                if (is_dir($file_path)) {
                    // $file is really the backupid
                    $status = self::delete_backup_dir($file, $progress);
                //If file
                } else {
                    unlink($file_path);
                }
            }
        }
        if (!$status) {
            throw new backup_helper_exception('problem_deleting_old_backup_temp_dirs');
        }
    }