Skip to content

Commit

Permalink
MDL-14736 Backup/Restore don't halt backup if can't delete temp files…
Browse files Browse the repository at this point in the history
… - just display notification and save error to log table
  • Loading branch information
danmarsden committed Mar 3, 2009
1 parent 6e5e0c9 commit 9d043b8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion backup/backup_scheduled.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ function schedule_backup_cron() {
//Delete old_entries from backup tables
if ($status) {
mtrace(" Deleting old data");
$status = backup_delete_old_data();
if (!backup_delete_old_data()) {;
$errorstr = "An error occurred deleting old backup data";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'scheduledbackup');
mtrace(" ".$errorstr);
}
}

//Now we get a list of courses in the server
Expand Down
8 changes: 7 additions & 1 deletion backup/restorelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -7497,7 +7497,13 @@ function restore_precheck($id,$file,&$errorstr,$noredirect=false) {
if (!defined('RESTORE_SILENTLY')) {
echo "<li>".get_string("deletingolddata").'</li>';
}
$status = backup_delete_old_data();
if (!backup_delete_old_data()) {;
$errorstr = "An error occurred deleting old data";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'restoreprecheck');
if (!defined('RESTORE_SILENTLY')) {
notify($errorstr);
}
}
}

//Now copy he zip file to dataroot/temp/backup/backup_unique_code
Expand Down

0 comments on commit 9d043b8

Please sign in to comment.