The get_directory_list() function was being executed with
directories excluded so backup_delete_old_dirs() was no working fine! This should delete REALLY old dirs in sites with problems in their scheduled backup. Merged from MOODLE_14_STABLE
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<?php //$Id$
|
||||
<?PHP //$Id$
|
||||
//This file contains all the function needed in the backup utility
|
||||
//except the mod-related funtions that are into every backuplib.php inside
|
||||
//every mod directory
|
||||
@@ -261,8 +261,9 @@
|
||||
$rootdir = $CFG->dataroot."/users";
|
||||
//Check if directory exists
|
||||
if (is_dir($rootdir)) {
|
||||
$coursedirs = get_directory_list($rootdir);
|
||||
foreach ($coursedirs as $dir) {
|
||||
//Get directories without descend
|
||||
$userdirs = get_directory_list($rootdir,"",false,true,false);
|
||||
foreach ($userdirs as $dir) {
|
||||
//Extracts user id from file path
|
||||
$tok = strtok($dir,"/");
|
||||
if ($tok) {
|
||||
@@ -313,7 +314,8 @@
|
||||
$rootdir = $CFG->dataroot."/$course";
|
||||
//Check if directory exists
|
||||
if (is_dir($rootdir)) {
|
||||
$coursedirs = get_directory_list($rootdir,$CFG->moddata);
|
||||
//Get files and directories without descend
|
||||
$coursedirs = get_directory_list($rootdir,$CFG->moddata,false,true,true);
|
||||
$backupdata_dir = "backupdata";
|
||||
foreach ($coursedirs as $dir) {
|
||||
//Check it isn't backupdata_dir
|
||||
|
||||
+2
-1
@@ -58,7 +58,8 @@
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
$list = get_directory_list($CFG->dataroot."/temp/backup", "", false);
|
||||
//Get files and directories in the temp backup dir witout descend
|
||||
$list = get_directory_list($CFG->dataroot."/temp/backup", "", false, true, true);
|
||||
foreach ($list as $file) {
|
||||
$file_path = $CFG->dataroot."/temp/backup/".$file;
|
||||
$moddate = filemtime($file_path);
|
||||
|
||||
Reference in New Issue
Block a user