Jump to content
InvisionCommunity.de - Der Deutsche Invision Community Support
Sign in to follow this  
cyber

Backup

Recommended Posts

Kopier dir einfach den kompletten Inhalt deines Forenverzeichnis auf die heimische Festplatte. Dann alle x Tage / Wochen nur noch den Ordner Uploads bzw. Dateien, die sich durch ein Update geändert haben.

Zusätzlich einfach die komplette MySQL Datenbank sichern. Dies entweder über die Shell, falls Zugriff drauf ist. Ansonsten per phpMyAdmin oder sonstigen MySQL Backup Tools. Das MySQL Backup alle x Tage/Wochen wiederholen, je nach Bedarf und Aktivität im Forum.

Ich hab mir für solche Zwecke ein Task programmiert, welches jeden Tag ein MySQL Backup macht, einmal in der Woche eine Optimierung über die Tabellen laufen läßt und alte Backupdateien, die älter als x Tage sind, löscht. :)

Share this post


Link to post

Ich hatte da hier mal gefunden. Musste mit php defrag.php per CronJob starten.

<HTML>

<HEAD>

<TITLE>IPB Forum MySQL Defrag</TITLE>

<style>

body,table{

font-size: 10px;

font-family: Arial;

}


.border{

border-width: 1px;

border-style: solid;

border-color: #000000;

}


tr.header{

background-color: #F8F5B6;

}

</style>

</HEAD>

<BODY>

<?php

$host = "localhost";

$user = "USER";

$pass = "PASS";

$dbase = "DATABASE";


$db = mysql_connect($host, $user, $pass) or die ("verbindung fehlgeschlagen");

   mysql_select_db($dbase, $db) or die ("verbindung zur datenbank fehlgeschlagen");

$sql = "show tables";

$r_sql = mysql_query($sql,$db);

if($r_sql){

echo "<table cellspacing=\"0\" cellpadding=\"0\" width=\"80%\" align=\"center\" class=\"border\"><tr><td>\n";

echo "<table cellspacing=\"0\" cellpadding=\"2\" width=\"100%\" align=\"center\" >\n";

echo "<tr class=\"header\"><td>Tabelle</td><td>Operation</td><td>Status</td><td>Operation</td><td>Status</td></tr>\n";

while($table = mysql_fetch_row($r_sql)){

$sql_o = "optimize table ".$table[0];

$r_sqlo = mysql_query($sql_o,$db);

$sql_c = "check table ".$table[0]." medium";

$r_sql_c = mysql_query($sql_c,$db);

if($r_sqlo){

$msg_o = mysql_fetch_array($r_sqlo);

$msg_c = mysql_fetch_array($r_sql_c);

if($msg_o['Msg_text'] == "Table is already up to date"){ $color = "#CAF9AE"; }

if($msg_o['Msg_text'] == "OK"){ $color = "#63EB66"; }

if($msg_o['Msg_text'] == "The handler for the table doesn't support check/repair"){ $color = "#F21C1C"; }

echo "<tr bgcolor=\"".$color."\"><td width=\"20%\" nowrap>".$table[0]."</td><td width=\"20%\" nowrap>".$msg_c[Op]."</td><td width=\"20%\" nowrap>".$msg_c[Msg_text]."</td><td width=\"20%\" nowrap>".$msg_o[Op]."</td><td width=\"20%\" nowrap>".$msg_o[Msg_text]."</td></tr>\n";

}

}

echo "</table>\n";

}

?>

</BODY>

</HTML>

Geht bei mir prima, starte es aber natürlich nicht als CronJob (wegen der HTML Ausgabe) ;)

Edited by kdt

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×