From: moodler Date: Sat, 7 Feb 2004 05:41:58 +0000 (+0000) Subject: A setting $CFG->preventscheduledbackups will prevent scheduled backups X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=74736e492263fdf8dcebafe8c496c5817b90a1f0;p=moodle.git A setting $CFG->preventscheduledbackups will prevent scheduled backups completely. --- diff --git a/admin/cron.php b/admin/cron.php index e8bfccc64f..9663653539 100644 --- a/admin/cron.php +++ b/admin/cron.php @@ -102,23 +102,25 @@ 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"; + } } }