2 require_once ("../config.php");
3 require_once ("backup_scheduled.php");
4 require_once ("lib.php");
5 require_once ("backuplib.php");
6 require_once ("$CFG->libdir/blocklib.php");
10 require_capability('moodle/site:restore', get_context_instance(CONTEXT_SYSTEM
));
13 if (!$site = get_site()) {
14 error("Site not found!");
17 //Check necessary functions exists. Thanks to gregb@crowncollege.edu
18 backup_required_functions();
20 //Adjust some php variables to the execution of this script
21 @ini_set
("max_execution_time","3000");
22 raise_memory_limit("192M");
28 $courses = get_records("course");
29 foreach ($courses as $course) {
30 echo "Start course ". format_string($course->fullname
);
31 $preferences = schedule_backup_course_configure($course);
32 if ($preferences && $status) {
33 $status = schedule_backup_course_execute($preferences);
35 if ($status && $preferences) {
36 echo "End course ". format_string($course->fullname
)." OK\n\n";
38 echo "End course ". format_string($course->fullname
)." FAIL\n\n";