When you name this System Rebuild you need more!
Code:
UPDATE domain SET domain_gid = "0";
UPDATE domain SET domain_uid = "0";
UPDATE domain SET domain_status = "toadd";
UPDATE subdomain SET subdomain_status = "toadd";
UPDATE domain_aliasses SET alias_status = "toadd";
update mail_users set status = "toadd";
TRUNCATE TABLE `auto_num`;
update htaccess_groups set status = "toadd";
update htaccess_users set status = "toadd";
now, when you have only (my backup script) the SQL.gz files
->>
http://www.isp-control.net/forum/backup-...t-360.html
you musst create all databases again! (DONT FORGET THE MYSQL DB! The Users are stored there!
Code:
<?php
mysql_connect("localhost","root","ROOTPASS") or die ("ERROR");
mysql_select_db("vhcs2") or die ("Die Datenbank existiert nicht");
$ergebnis = mysql_query("SELECT * FROM sql_database order by sqld_id DESC");
while($row = mysql_fetch_row($ergebnis))
{
$dbnamealt = $row[2];
echo "$dbnamealt<br>";
mysql_query("CREATE DATABASE `$dbnamealt`");
}
?>
Dumps gzip -d *
Code:
MYSQL DUMPS IMPORTIEREN
#!/bin/sh
ROOTPASS="XXXXX"
RESTORELIST=`find -name "*.sql" -maxdepth 1`
for i in $RESTORELIST
do
dateiname=$(echo $i | sed -e "s/\....$//")
dateiname=${dateiname:2}
mysql $dateiname < $dateiname.sql -p$ROOTPASS
done
echo FERTIG RESTORE!!
When you use my Backup Script
Code:
# BACKUPS IN DIE KUNDENORDNER SCHIEBEN
#!/bin/sh
RESTORELIST=`find -name "*.tar.gz" -maxdepth 1`
for i in $RESTORELIST
do
dateiname=$(echo $i | head -c -33)
dateiname=${dateiname:2}
echo $dateiname
original=${i:2}
mv $original /var/www/virtual/$dateiname/backups/$dateiname.tar.gz
chmod 660 /var/www/virtual/$dateiname/backups/$dateiname.tar.gz
rm /var/www/virtual/$dateiname/htdocs/index.html
done
echo FERTIG RESTORE!!
NOW!
Code:
UPDATE domain SET domain_status = "restore";
Request Manager start!!
->
OWNER Neusetzen!
Code:
## KUNDEN ORDNER NACHDEM RESTORE OWNER:GROUP SETZEN ;)
#!/bin/sh
CHOWN=`cat /etc/passwd | grep "vu2"`
for i in $CHOWN
do
OWNER=$(echo $i | cut -d ":" -f -1)
PFAD=$(echo $i | cut -d ":" -f 6)
GROUP=www-data
chown $OWNER:$GROUP $PFAD/ -R
echo $OWNER:$GROUP $PFAD/
done
## BACKUPS DEL!!
Code:
#!/bin/sh
RESTORELIST=`find /var/www/virtual/ -name "*.*" -maxdepth 1`
for i in $RESTORELIST
do
cd $i/backups/ && rm *.tar.gz
echo $i
done
echo FERTIG RESTORE!!
any ideas?