2004-08-07 00:03:08 +00:00
|
|
|
<?PHP //$Id$
|
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");
|
2004-08-07 00:03:08 +00:00
|
|
|
require_once ("$CFG->libdir/blocklib.php");
|
2003-12-01 22:00:00 +00:00
|
|
|
|
|
|
|
require_login();
|
|
|
|
|
2006-09-07 08:57:56 +00:00
|
|
|
require_capability('moodle/site:restore', get_context_instance(CONTEXT_SYSTEM, SITEID));
|
2003-12-01 22:00:00 +00:00
|
|
|
|
|
|
|
//Check site
|
|
|
|
if (!$site = get_site()) {
|
|
|
|
error("Site not found!");
|
|
|
|
}
|
|
|
|
|
|
|
|
//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");
|
2007-02-14 20:58:31 +00:00
|
|
|
raise_memory_limit("192M");
|
2003-12-01 22:00:00 +00:00
|
|
|
|
|
|
|
echo "<pre>\n";
|
|
|
|
|
|
|
|
$status = true;
|
|
|
|
|
|
|
|
$courses = get_records("course");
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|