diff --git a/backup/backup_scheduled.php b/backup/backup_scheduled.php index 82397401ca6..e3896b3b786 100644 --- a/backup/backup_scheduled.php +++ b/backup/backup_scheduled.php @@ -479,14 +479,15 @@ function schedule_backup_course_execute($preferences,$starttime = 0) { //Create them as needed schedule_backup_log($starttime,$preferences->backup_course," checking temp structures"); $status = check_and_create_backup_dir($preferences->backup_unique_code); - //Empty dir + //Empty backup dir if ($status) { - schedule_backup_log($starttime,$preferences->backup_course," cleaning old data"); + schedule_backup_log($starttime,$preferences->backup_course," cleaning current dir"); $status = clear_backup_dir($preferences->backup_unique_code); } //Delete old_entries from backup tables if ($status) { + schedule_backup_log($starttime,$preferences->backup_course," cleaning old data"); $status = backup_delete_old_data(); } diff --git a/backup/lib.php b/backup/lib.php index ebddb96b0f3..c76533585ff 100644 --- a/backup/lib.php +++ b/backup/lib.php @@ -25,15 +25,15 @@ } //Delete old data in backup tables (if exists) - //Two days seems to be apropiate + //Four hours seem to be appropiate now that backup is stable function backup_delete_old_data() { global $CFG; //Change this if you want !! - $days = 2; + $hours = 4; //End change this - $seconds = $days * 24 * 60 * 60; + $seconds = $hours * 60 * 60; $delete_from = time()-$seconds; //Now delete from tables $status = execute_sql("DELETE FROM {$CFG->prefix}backup_ids diff --git a/backup/restore_precheck.html b/backup/restore_precheck.html index 015e00760cf..72cfa5d8a73 100644 --- a/backup/restore_precheck.html +++ b/backup/restore_precheck.html @@ -52,10 +52,10 @@ $backup_unique_code = time(); //Now check and create the backup dir (if it doesn't exist) + echo "
  • ".get_string("creatingtemporarystructures"); $status = check_and_create_backup_dir($backup_unique_code); //Empty dir if ($status) { - echo "
  • ".get_string("creatingtemporarystructures"); $status = clear_backup_dir($backup_unique_code); }