Modified to delete temp files older than 4 hours (previously it was
configured to 48 hours). Force to execute the clean before doing the backup itself. This should avoid the disk full of temp backup files issue. See bug 1520. http://moodle.org/bugs/bug.php?op=show&bugid=1520 Changes merged from MOODLE_13_STABLE.
This commit is contained in:
+3
-3
@@ -25,15 +25,15 @@
|
||||
}
|
||||
|
||||
//Delete old data in backup tables (if exists)
|
||||
//Two days seems to be apropiate
|
||||
//Four hours seem to be appropiate now that backup is stable
|
||||
function backup_delete_old_data() {
|
||||
|
||||
global $CFG;
|
||||
|
||||
//Change this if you want !!
|
||||
$days = 2;
|
||||
$hours = 4;
|
||||
//End change this
|
||||
$seconds = $days * 24 * 60 * 60;
|
||||
$seconds = $hours * 60 * 60;
|
||||
$delete_from = time()-$seconds;
|
||||
//Now delete from tables
|
||||
$status = execute_sql("DELETE FROM {$CFG->prefix}backup_ids
|
||||
|
||||
Reference in New Issue
Block a user