1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-24 01:44:27 +02:00

MDL-14736 Backup/Restore don't halt backup if can't delete temp files - just display notification and save error to log table

This commit is contained in:
danmarsden 2009-03-03 01:18:16 +00:00
parent 6e5e0c9363
commit 9d043b8c6b
2 changed files with 12 additions and 2 deletions

@ -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

@ -7497,7 +7497,13 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
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