-
Bug
-
Resolution: Fixed
-
Blocker
-
1.9.13, 2.0.4, 2.1.1, 2.2
-
Any
-
MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
-
MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_21_STABLE
-
wip-
MDL-25454-master -
backup/backup_scheduled.php contains code that prevents hidden courses from being backed up if they have not been modified in the last month:
// Skip backup of unavailable courses that have remained unmodified in a month
|
$skipped = false;
|
if (!$course->visible && ($now - $course->timemodified) > 31*24*60*60) { //Hidden + unmodified last month
|
mtrace(" SKIPPING - hidden+unmodified");
|
$DB->set_field("backup_courses","laststatus","3", array("courseid"=>$backup_course->courseid));
|
$skipped = true;
|
}
|
However, $course->timemodified is only changed when the function "update_course" is called. This only happens when the course's "settings" page (course/edit.php) has been submitted with changes.
If a user is editing a course while it is hidden from students, it will not be backed up unless they change a setting.
Steps to reproduce:
- Hide a course
- In the database, change mdl_course.timemodified to a Unix timestamp older than 31 days, e.g. UPDATE mdl_course SET timemodified = UNIX_TIMESTAMP() - 32 * 86400
- Make some changes to the course, e.g. add some resources.
- Trigger a scheduled backup
Expected outcome: The course is backed up
Observed outcome: The course is skipped during scheduled backup, and no backup file is created.
I'm not sure what the best fix is. Something that queries mdl_log, perhaps, e.g.
SELECT MAX(time) from mdl_log WHERE course = <course id> AND action IN (<list of "update"-type actions>)
Alternatively, perhaps there should be a mechanism for updating timemodified in mdl_course when such changes are made.
- has a non-specific relationship to
-
MDL-25994 Automated course backups not working since upgrade to 2.0.1
- Closed
-
MDL-4694 Auto-backup optimisation - skip old unavailable unmodified courses
- Closed
- has been marked as being related by
-
MDL-28531 Automated backups run not on the time they are scheduled
- Closed
-
MDL-32148 Automated backups : Skip backup of courses that have remained unmodified since last backup
- Closed
- is duplicated by
-
MDL-30215 Hidden courses that have remained unmodified in a month should not be skipped from backup
- Closed
- will be (partly) resolved by
-
MDL-28435 Reports are shown in course "change log"
- Closed
- will help resolve
-
MDL-28162 [ERROR] Automated backup status
- Closed
-
MDL-28242 Old courses may never get backed up with automated backups
- Closed