]> git.mjollnir.org Git - moodle.git/commitdiff
A setting $CFG->preventscheduledbackups will prevent scheduled backups
authormoodler <moodler>
Sat, 7 Feb 2004 05:41:58 +0000 (05:41 +0000)
committermoodler <moodler>
Sat, 7 Feb 2004 05:41:58 +0000 (05:41 +0000)
completely.

admin/cron.php

index e8bfccc64faf31ae821f7c49177325884e4ae25d..9663653539eb8c4dba944040f85ac880e6a35097 100644 (file)
         include("$CFG->dataroot/cronextra.php");
     }
 
-    //Execute backup's cron
-    //Perhaps a long time and memory could help in large sites
-    ini_set("max_execution_time","3000");
-    ini_set("memory_limit","56M");
-    if (file_exists("$CFG->dirroot/backup/backup_scheduled.php") and
-        file_exists("$CFG->dirroot/backup/backuplib.php") and
-        file_exists("$CFG->dirroot/backup/lib.php")) {
-        include_once("$CFG->dirroot/backup/backup_scheduled.php");
-        include_once("$CFG->dirroot/backup/backuplib.php");
-        include_once("$CFG->dirroot/backup/lib.php");
-        echo "Running backups if required...\n";
-        flush();
-
-        if (! schedule_backup_cron()) {
-            echo "Something went wrong while performing backup tasks!!!\n";
-        } else {
-            echo "Backup tasks finished\n";
+    if (!isset($CFG->preventscheduledbackups)) {   // Defined in config.php
+        //Execute backup's cron
+        //Perhaps a long time and memory could help in large sites
+        set_time_limit(0);
+        ini_set("memory_limit","56M");
+        if (file_exists("$CFG->dirroot/backup/backup_scheduled.php") and
+            file_exists("$CFG->dirroot/backup/backuplib.php") and
+            file_exists("$CFG->dirroot/backup/lib.php")) {
+            include_once("$CFG->dirroot/backup/backup_scheduled.php");
+            include_once("$CFG->dirroot/backup/backuplib.php");
+            include_once("$CFG->dirroot/backup/lib.php");
+            echo "Running backups if required...\n";
+            flush();
+    
+            if (! schedule_backup_cron()) {
+                echo "Something went wrong while performing backup tasks!!!\n";
+            } else {
+                echo "Backup tasks finished\n";
+            }
         }
     }