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

Courses automated backup does not delete old backups from filesystem when backup_shortname is set

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.3, 2.3
    • Fix Version/s: 2.2.5, 2.3.2
    • Component/s: Backup
    • Labels:
    • Database:
      Any
    • Testing Instructions:
      Hide

      These testing instructions includes the execution of automated backups, so less courses = faster automated backup

      1.- Enable automated backups with this setting:
      .backup_auto_active to 'manual'
      .backup_auto_storage to 'Specified directory for automated backups'
      .set backup_auto_destination wherever you want
      .backup_auto_keep to '1'
      .check backup_shortname
      2.- Execute "sudo -u www-data /usr/bin/php admin/cli/automated_backups.php" from the command line
      2.- Execute again "sudo -u www-data /usr/bin/php admin/cli/automated_backups.php" from the command line
      3.- Check backup_auto_directory folder, there SHOULD be just one backup file per course

      Show
      These testing instructions includes the execution of automated backups, so less courses = faster automated backup 1.- Enable automated backups with this setting: .backup_auto_active to 'manual' .backup_auto_storage to 'Specified directory for automated backups' .set backup_auto_destination wherever you want .backup_auto_keep to '1' .check backup_shortname 2.- Execute "sudo -u www-data /usr/bin/php admin/cli/automated_backups.php" from the command line 2.- Execute again "sudo -u www-data /usr/bin/php admin/cli/automated_backups.php" from the command line 3.- Check backup_auto_directory folder, there SHOULD be just one backup file per course
    • Workaround:
      Hide

      New if() to add the id or the shortname to the regexp, the same process backup_plan_dbops::get_default_backup_filename() does, by Lorenzo Nicora. Another way to get the regexp could be calling backup_plan_dbops::get_default_backup_filename() and hacking it's return to remove the last -*, but IMO this alternative is more tricky

      Show
      New if() to add the id or the shortname to the regexp, the same process backup_plan_dbops::get_default_backup_filename() does, by Lorenzo Nicora. Another way to get the regexp could be calling backup_plan_dbops::get_default_backup_filename() and hacking it's return to remove the last -*, but IMO this alternative is more tricky
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-33531_master

      Description

      In my moodle, automated backups are set as follow:

      • Storage: specified directory of local filesystem
      • backup_auto_keep: 1
      • Course names are used in backup filename
      • Backups include everything, except logs and histories
      • Backup logs lifetime: 7 days

      After installed version 2.2.3, and set to use course names in filename and backuplog lifetime, old backups files are not deleted from filesystem, although keep is 1, old backups stay there forever.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  6 Vote for this issue
                  Watchers:
                  9 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    10/Sep/12