Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-34146

Old automated backups not deleted from backup_auto_destination when backup_shortname is true

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.2.3
    • Backup
    • None
    • MOODLE_22_STABLE

      Steps to reproduce:

      1. In "Automated backup setup": set backup_auto_active to "Manual"; set backup_auto_storage to "Specified directory for automated backups"; set a valid path for "backup_auto_destination"; set backup_auto_keep to 1; tick "backup_shortname"
      2. From the cli, run /admin/cli/automated_backups.php to generate backup files
      3. Run it a second time

      Expected behaviour:

      Only one copy of the course backup file should be kept.

      Observed behaviour:

      Two backup files for each course now exist.

      Cause:

      Line 504 of /backup/util/helper/backup_cron_helper.class.php is:

      $filename = $backupword . '-' . backup::FORMAT_MOODLE . '-' . backup::TYPE_1COURSE . '-' .$course->id . '-';

      This is used to build a regular expression to match old copies of the backup files. But if you are using course->shortname instead of course->id in the filename, it cannot match the file, so it remains on the filesystem.

      The workaround is to unset "backup_shortname", but this makes identifying your course backup files more difficult.

            stronk7 Eloy Lafuente (stronk7)
            chrisf Chris Fryer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.