|
Dan Marsden made changes - 13/May/08 07:34 AM
--should also check to see if backup is silent and only notify when not silent, and should log an entry to backup_log here's a patch that works - will commit something close to this in 1.9 and HEAD
if (!empty($object->backup)) { the $status=false for silent backup imo isn't enough either... - as part of
Dan
Dan Marsden made changes - 13/May/08 08:40 AM
Dan Marsden committed 1 file to 'Moodle CVS' - 13/May/08 08:41 AM
Dan Marsden committed 1 file to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 13/May/08 08:45 AM
patch now in 1.9stable and Head
first version of adding new field to backup_log table. - Note: this doesn't provide any extra logging. - just adds the field to backup_log - if this is ok I will commit to HEAD only, and then we can work on improving error reporting in other areas of the backup/restore.
Dan
Dan Marsden made changes - 14/May/08 09:23 AM
attaching patch to add backup_add_to_log() calls to backuplib.php so I don't lose it!
Dan
Dan Marsden made changes - 10/Jun/08 10:49 AM
new patch for HEAD to modify backup_log table to include a "backuptype" field - this means we can use it for other backup related logs. (eg silent backups)
Dan Marsden made changes - 03/Mar/09 07:33 AM
updating patch - missed a global call
Dan Marsden made changes - 03/Mar/09 07:45 AM
Hi Dan,
I think backup_log_table.patch (7 kB) looks ok. The older backup_log_patch.txt (23 kB) won't work anymore (backup tables were transferred to core lib/db some weeks ago). As far as current scheduled logs are written with 'scheduledbackup' and retrieved in that way, it seems ok... although what happens with "old" records? It seems that the new field isn't filled ever for those old records... thanks Eloy - yeah - the other files are old, I'm only planning on committing the backup_log_table.patch file now, I'll work on the other stuff later once the db changes are in. - good point about old records! - I'll add a check to add 'scheduledbackup' to the backuptype field of all old records. - thanks!
Dan Marsden committed 6 files to 'Moodle CVS' - 03/Mar/09 09:06 AM
Dan Marsden committed 1 file to 'Moodle CVS' - 03/Mar/09 09:53 AM
Changes now in HEAD
1. - new field in backup_log table to allow manual backups to report errors there There are probably further areas for improvement, but closing this issue as fixed for now - We can use other Tracker issues for further improvements! - if anyone disagrees, feel free to re-open!
Dan
Dan Marsden made changes - 03/Mar/09 09:57 AM
Looks perfect.
My only comment is if, instead of executing that: $DB->execute("UPDATE {backup_log} SET backuptype='scheduledbackup'"); we should use one simpler $DB->set_field() or, perhaps, if using 'scheduledbackup' is better for some databases (fill on creation instead of update). But I guess it isn't really important. Good work. Closing... ciao
Eloy Lafuente (stronk7) made changes - 04/Mar/09 08:43 AM
Dan Marsden made changes - 04/Mar/09 11:41 AM
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
an example is function backup_module (line 2278 in backuplib.php in current MOODLE_19).
foreach ($preferences->mods[$module]->instances as $instance => $object) {
if (!empty($object->backup)) { $status = $onemodbackup($bf,$preferences,$instance); }
}
As you can see, this will set the final 'status' value to whatever the last module returned. So if modules 1, 2, 3, and 4 fail, but module 5 passes, this function returns success. This is clearly wrong. In addition, this function also does not output any status information - which should be visible always-displayed status information, not just
debugging() - indicating which module instance has actually failed.
The way this was written (status value getting overwritten, not displaying information about which module caused a failure) appeared to me to be endemic across backup/restore code - that's what I wanted sorting out.