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");
11 error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
15 if (!$site = get_site()) {
16 error("Site not found!");
19 //Check necessary functions exists. Thanks to gregb@crowncollege.edu
20 backup_required_functions();
22 //Adjust some php variables to the execution of this script
23 @ini_set
("max_execution_time","3000");
24 raise_memory_limit("128M");
30 $courses = get_records("course");
31 foreach ($courses as $course) {
32 echo "Start course ".$course->fullname
;
33 $preferences = schedule_backup_course_configure($course);
34 if ($preferences && $status) {
35 $status = schedule_backup_course_execute($preferences);
37 if ($status && $preferences) {
38 echo "End course ".$course->fullname
." OK\n\n";
40 echo "End course ".$course->fullname
." FAIL\n\n";