-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
2.2.3
-
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.