Moodle
  1. Moodle
  2. MDL-34146

Old automated backups not deleted from backup_auto_destination when backup_shortname is true

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.2.3
    • Fix Version/s: None
    • Component/s: Backup
    • Labels:
      None
    • Affected Branches:
      MOODLE_22_STABLE
    • Rank:
      42478

      Description

      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.

        Issue Links

          Activity

          Hide
          Christopher Hill added a comment -

          Same as MDL-33531???

          Show
          Christopher Hill added a comment - Same as MDL-33531 ???
          Hide
          Chris Fryer added a comment -

          Sorry, yes I missed that.

          Show
          Chris Fryer added a comment - Sorry, yes I missed that.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Hi, I'm closing this as duplicate of MDL-33812, where the problem is being fixed. Thanks for the report!

          Show
          Eloy Lafuente (stronk7) added a comment - Hi, I'm closing this as duplicate of MDL-33812 , where the problem is being fixed. Thanks for the report!

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: