below is the script that i copied from 
http://v2gnu.com/qmail/restore-1.2.sh.txt . 

let suppose if i want to restore qmail toaster then what i have to do??

- copy backup file in /root folder.

- may i have to run these commands one by one??or is there any way to copy 
these commands in a single file and just run that file.

-how many places i have to change pass???just at one line??or multiple lines???

 

 

 

#################################################
#      Set the variables below!!!
#################################################

# Please put your MySQL ROOT password below:
mysqlrootpass=your_password

#################################################
#      I can't think of any more variables I 
#      need, so here's the restore script!
#################################################

# We're stopping QMail (if it's running), and uncompressing all the archives.
# Then we move them back to where they're supposed to be

cd /root
clear
echo
echo "Uncompressing the backup file...."
tar xzf *-backup.tar.gz

echo
echo "Stopping QMail (if it's running) for the restoration process...."
qmailctl stop
sleep 2

echo
echo "Uncompressing and replacing the assign files...."
tar xjf *-assign.tar.bz2
cd var/qmail/users
cp -rf assign /var/qmail/users/
cd /root

echo
echo "Uncompressing and replacing control files...."
tar xjf *-qmailcontrol.tar.bz2
cp -rf rcp* /var/qmail/control/
cp -rf virtual* /var/qmail/control/
cp -rf more* /var/qmail/control/
cp -rf bad* /var/qmail/control/
cp -rf black* /var/qmail/control/
cp -rf concurrency* /var/qmail/control/
cp -rf data* /var/qmail/control/
cp -rf queue* /var/qmail/control/
cp -rf smtp* /var/qmail/control/

echo
echo "Uncompressing and replacing vpopmail (all users and emails stored at 
backup)"
echo "NOTE: This is going to delete *ANY* users and emails on this server 
previously"
tar xjf *-vpopmail.tar.bz2
cd home/vpopmail
cp -rfp domains /home/vpopmail/
cd /home/vpopmail/domains
chown -R vpopmail:vchkpw *
cd /root

echo
echo "Uncompressing and replacing the MySQL database (vpopmail)...."
gunzip -d *-vpopmail.sql.gz
# We had a quirky problem - if the database file had an extension, it didn't 
get imported right
mv *-vpopmail.sql vpopmail

########################################################################################
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#       This next command destroys anything you may have in the vpopmail MySQL
#       database up to this point! We warned you!
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
########################################################################################

mysqladmin -f -uroot -p$mysqlrootpass drop vpopmail
mysqladmin -uroot -p$mysqlrootpass flush-tables
mysqladmin -uroot -p$mysqlrootpass refresh
mysqladmin -uroot -p$mysqlrootpass reload

mysqladmin create vpopmail -uroot -p$mysqlrootpass

mysql -uroot -p$mysqlrootpass vpopmail < vpopmail
mysqladmin -uroot -p$mysqlrootpass reload
mysqladmin -uroot -p$mysqlrootpass refresh

# Now we're going to change the permissions with the queue_repair utility, to 
fix
# any problems that may have been missed, and to fixed iNodes for the mail that 
was still in
# the queue when the archive was created on the original machine.  This script 
was written
# by Charles Cazabon (pqt @ discworld.dydns.org) under GNU version 2 in Python 
and is
# is supplied with this restore script (no reason to reinvent the wheel)

echo
echo "Running Charles Cazabon's queue_repair python utility to fix any loose 
ends...."
sleep 3
cd queue-repair-0.9.0
chmod 777 queue_repair.py
./queue_repair.py -r

echo
echo "Running qmail-newu for any other loose ends...."
cd /root
/var/qmail/bin/qmail-newu

echo "Reloading (and refreshing) MySQL and Apache...."
mysqladmin -uroot -p$mysqlrootpass reload
mysqladmin -uroot -p$mysqlrootpass refresh
service httpd reload

###  Convert old .qmail aliases to new format
#/home/vpopmail/bin/dotqmail2valias -a

echo "Rebuilding QMail's CDB and starting the mail server...."
qmailctl cdb
qmailctl start

# Now everything should be up and running again, with everything restored to 
when you did the
# backup. 

echo
echo
echo "Your QMail-Toaster server should now be restored. Double check everything 
by logging"
echo "into the domains to make sure they're really there, and that the users 
imported"
echo "correctly. Might not also hurt to do a reboot to clean up any loose 
stacks and"
echo "services that did not start cleanly."

                                          
_________________________________________________________________
Looking for a place to rent, share or buy? Find your next place with ninemsn 
Property
http://clk.atdmt.com/NMN/go/157631292/direct/01/

Reply via email to