H-Sphere DB recovery scripts

WARNING: You can execute recovery script as root (if your CP server was broken), but it will ask root password for all logical web or mail servers. That is why I recommend to execute it as user cpanel.

Log into CP as user cpanel:
[root@cp test]# su - cpanel
Download archive recovery_db.tgz:
bash-2.05a$ wget http://www.root0.net/script/recovery_db.tgz
--12:25:35--  http://www.root0.net/script/recovery_db.tgz
           => `recovery_db.tgz'
Resolving www.root0.net... done.
Connecting to www.root0.net[68.36.214.121]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 42,843 [application/x-tar]

100%[============================================================================>] 42,843        40.86M/s    ETA 00:00

12:25:35 (40.86 MB/s) - `recovery_db.tgz' saved [42843/42843]
Unpack and go to recovery_db directory:
bash-2.05a$ tar xzf recovery_db.tgz
bash-2.05a$ cd recovery_db
Binary files already exists, but you can recompile them from sources. In this case run make:
bash-2.05a$ make
gcc -o recovery recovery.sh.c
gcc -o cmd_web  cmd_web.sh.c
gcc -o cmd_mail cmd_mail.sh.c
Put IPs of all web servers to logical_web file and IPs of all mail servers to logical_mail file. One IP on line:
bash-2.05a$ vi logical_web
bash-2.05a$ vi logical_mail
Run recovery script without parameters:
bash-2.05a$ ./recovery
*************************************************************
            H-Sphere database recovery script
 For more details see http://www.root0.net/script/index.html
*************************************************************
 Make sure that
  logical_web file contains list of logical WEB server IPs
  logical_mail file contains list of logical MAIL server IPs
*************************************************************
Continue? [Y/n]:
===> Web server 127.0.0.1 ...
cmd_web              100% |*********************************************************************| 25479       00:00
out_web_127.0.0.1    100% |*********************************************************************|  3453       00:00
===> Web server 127.0.0.1 [ OK ]
===> Mail server 127.0.0.1 ...
cmd_mail             100% |*********************************************************************| 24296       00:00
out_mail_127.0.0.1   100% |*********************************************************************|  1251       00:00
===> Mail server 127.0.0.1 [ OK ]

...


*************************************************************
   File recovery.xml created successfully. Congratulation.
************************************** (c) root0.net 2004 ***
bash-2.05a$
That is all. Now you can use recovery.xml with CommonUserCreator.


Home
© root0.net