2009-11-01 15:39:15 +00:00
|
|
|
<?PHP
|
2003-12-01 22:00:00 +00:00
|
|
|
require_once ("../config.php");
|
|
|
|
require_once ("backup_scheduled.php");
|
|
|
|
require_once ("lib.php");
|
|
|
|
require_once ("backuplib.php");
|
|
|
|
|
|
|
|
require_login();
|
|
|
|
|
2008-05-02 04:37:02 +00:00
|
|
|
require_capability('moodle/site:restore', get_context_instance(CONTEXT_SYSTEM));
|
2003-12-01 22:00:00 +00:00
|
|
|
|
2009-11-01 09:21:41 +00:00
|
|
|
$site = get_site();
|
2003-12-01 22:00:00 +00:00
|
|
|
|
|
|
|
//Check necessary functions exists. Thanks to gregb@crowncollege.edu
|
|
|
|
backup_required_functions();
|
|
|
|
|
|
|
|
//Adjust some php variables to the execution of this script
|
2004-09-08 22:47:19 +00:00
|
|
|
@ini_set("max_execution_time","3000");
|
2009-03-30 10:07:24 +00:00
|
|
|
if (empty($CFG->extramemorylimit)) {
|
2009-03-26 02:09:28 +00:00
|
|
|
raise_memory_limit('128M');
|
|
|
|
} else {
|
2009-03-30 10:07:24 +00:00
|
|
|
raise_memory_limit($CFG->extramemorylimit);
|
2009-03-26 02:09:28 +00:00
|
|
|
}
|
2003-12-01 22:00:00 +00:00
|
|
|
|
|
|
|
echo "<pre>\n";
|
|
|
|
|
|
|
|
$status = true;
|
|
|
|
|
2008-06-01 14:46:48 +00:00
|
|
|
$courses = $DB->get_records("course");
|
2003-12-01 22:00:00 +00:00
|
|
|
foreach ($courses as $course) {
|
2007-02-28 06:25:22 +00:00
|
|
|
echo "Start course ". format_string($course->fullname);
|
2003-12-01 22:00:00 +00:00
|
|
|
$preferences = schedule_backup_course_configure($course);
|
|
|
|
if ($preferences && $status) {
|
|
|
|
$status = schedule_backup_course_execute($preferences);
|
|
|
|
}
|
|
|
|
if ($status && $preferences) {
|
2007-02-28 06:25:22 +00:00
|
|
|
echo "End course ". format_string($course->fullname)." OK\n\n";
|
2003-12-01 22:00:00 +00:00
|
|
|
} else {
|
2007-02-28 06:25:22 +00:00
|
|
|
echo "End course ". format_string($course->fullname)." FAIL\n\n";
|
2003-12-01 22:00:00 +00:00
|
|
|
}
|
|
|
|
}
|