*Backup your qmailtoster server to an other server.*
Through necessity, I have created a Backup server ( server2 ) to act as a copy of my main qmailserver ( server1 ) and automated the process.

*Note this is not the only method , and I give no guarantees it will work for you.* I installed two server identically using QMT.iso Centos 5, from our great friend Jake Vickers.

*Login to server 1 (your IP address ) 192.168.1.100*
cd /root
Create the Key file
ssh-keygen -t dsa ( this will be called id_dsa_pub ) in the /root/.ssh/ folder

Check the file exists
cd .ssh/
ls

Copy file to Server 2 ( your IP address ) 192.168.1.101
scp id_dsa.pub [email protected]:/root/.ssh/
enter root password on server 2
*
SSH to server 2*
ssh [email protected]
enter root password again

Check the file came across
cd /root/.ssh
ls

Add the key to the authorized_keys files
cat id_dsa.pub >> /root/.ssh/authorized_keys

Your server 2 is now setup to allow root to login from server1.
Exit and login again, it should not ask for a password if all went well.

ssh [email protected]
exit, back to server 1.
*
Your back up should be in the /backup/*
Called something like 200904280102-backup.tar.gz ( year, month, date, time-backup.tar.gz )

Depending on your system, it can take hours. So I created a script, to backup then SCP the backup to server 2
*Here is mine: /root/backup.sh*

#!/bin/sh
# run backup command
/usr/sbin/qtp-backup
#
# Copy file to server 2 using SCP to the /root folder
cd /backup
scp -backup.tar.gz [email protected]:/root/
exit

*save the file , and make it executable:*
chmod +x backup.sh
*
On server 1 make a cron job to run the backup (mine is at 02:00 )*
crontab -e
*2 * * * /root/backup.sh

The scrip will copy -backup.tar.gz,  to server2

*Thanks to Erik Schubert,  modify the qtp-restore script.*
Change:
read -p "Please enter your MySQL Root password: " mysqlrootpass

to
read -p "Please enter your MySQL Root password: " mysqlrootpass
mysqlrootpass=your_password
*
Save it ..

create a cron job for the restore : i run mine at 04:00*
crontab -e
* 4 * * * /usr/sbin/qtp-restore

*Login to server2 and double check everything restored, you may have to reboot , not sure yet.* If your main qmail server goes down, just log into server 2 and change the IP address to that of server 1. ( 192.168.1.100 )
Hope this helps someone, as it was to late for me.
All my tests worked, this is a true working environment, not a Lab test.

Any errors found please let me know, but as i said , it works for me.
MadMac







---------------------------------------------------------------------------------
                Managed Qmailtoaster servers are now available
      Visit http://qmailtoaster.com/QMTManaged.html to order yours today!

Qmailtoaster is sponsored by Vickers Consulting Group 
(www.vickersconsulting.com)

    Please visit qmailtoaster.com for the latest news, updates, and packages.


         To unsubscribe, e-mail: [email protected]
        For additional commands, e-mail: [email protected]


Reply via email to