diff --git a/backup/backup.php b/backup/backup.php index a14b71a7ae2..511775f7605 100644 --- a/backup/backup.php +++ b/backup/backup.php @@ -112,13 +112,13 @@ print_simple_box_start("center", "", "$THEME->cellheading"); //Call the form, depending the step we are if (!$launch) { - include_once("backup.html"); + include_once("backup_form.html"); } else { if ($launch == "check") { - include_once("check.html"); + include_once("backup_check.html"); } if ($launch == "execute") { - include_once("check.html"); + include_once("backup_execute.html"); } } print_simple_box_end(); diff --git a/backup/lib.php b/backup/lib.php index ce9f3a43e25..16dd25842d9 100644 --- a/backup/lib.php +++ b/backup/lib.php @@ -173,6 +173,20 @@ return $info; } - - + + //Delete old data in backup tables (if exists) + //Two days seems to be apropiate + function backup_delete_old_data() { + //Change this if you want !! + $days = 2; + //End change this + $seconds = days * 24 * 60 * 60; + $delete_from = time()-$seconds; + //Now delete from tables + $status = execute_sql("DELETE FROM {$CFG->prefix}backup_ids b + WHERE b.backup_code < '$delete_from'",false); + $status = execute_sql("DELETE FROM {$CFG->prefix}backup_files b + WHERE b.backup_code < '$delete_from'",false); + return($status); + } ?>