From cb27c4e823e0d6650d869af326780a4f7d722fe5 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Wed, 7 Jun 2006 22:22:21 +0000 Subject: [PATCH] Solve one issue with skipped courses and email to admin being set every xx minutes. Bug 5621. (http://moodle.org/bugs/bug.php?op=show&bugid=5621) Merged from MOODLE_16_STABLE --- backup/backup_scheduled.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/backup/backup_scheduled.php b/backup/backup_scheduled.php index e6ebd5664f..8af3c16dd9 100644 --- a/backup/backup_scheduled.php +++ b/backup/backup_scheduled.php @@ -100,16 +100,17 @@ function schedule_backup_cron() { $status = false; continue; } - //Now we backup every course with nextstarttime < now - if ($backup_course->nextstarttime > 0 && $backup_course->nextstarttime < $now) { + // 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"); + set_field("backup_courses","laststatus","3","courseid",$backup_course->courseid); + $skipped = true; + } + //Now we backup every non skipped course with nextstarttime < now + if (!$skipped && $backup_course->nextstarttime > 0 && $backup_course->nextstarttime < $now) { //We have to send a email because we have included at least one backup $emailpending = true; - // Skip backup of unavailable courses that have remained unmodified in a month - if (!$course->visible && ($now - $course->timemodified) > 31*24*60*60) { //Hidden + unmodified last month - mtrace(" SKIPPING - hidden+unmodified"); - set_field("backup_courses","laststatus","3","courseid",$backup_course->courseid); - continue; - } //Only make the backup if laststatus isn't 2-UNFINISHED (uncontrolled error) if ($backup_course->laststatus != 2) { //Set laststarttime -- 2.39.5