[Tfug] mirroring a linux server

Paul Lemmons paul at lemmons.name
Thu Oct 16 10:37:01 MST 2008


-------- Original Message  --------
Subject: [Tfug] mirroring a linux server
From: doug1 at email.arizona.edu
To: tfug at tfug.org
Date: 10/16/2008 10:05 AM
> Hi,
>  I want to mirror a linux server onto a backup linux server they are on two
> different subnets is their any native linux functions that I can use to perform
> regular backups? Also there is another complication the new server uses Mysql
> V5.0 and the old server uses a much earlier copy of Mysql I dont know how to
> set up a master slave relationship between the two servers, so that the master
> sends the bin files to the slave could someone walk me through it please?
>
> thank you
>   
I do this here for a web server running drupl. That means I have to 
backup any changes in the web server directory as well as the mysql 
database. I have a script that uses rsync and mysqldump/mysql to 
accomplish the task.


[]$ cat /usr/local/bin/sync_mysql.ksh
mysqldump                  \
      --host=localhost     \
      --user=root          \
      --password=......... \
      --all-databases      \
      --add-drop-database  \
      --allow-keywords     \
      --create-options     \
      --extended-insert    \
      --lock-all-tables    \
|                          \
mysql                      \
      --host=otherhost     \
      --user=root          \
      --password=.........

[]$ cat /usr/local/bin/sync_www.ksh
#!/bin/bash
options="\
      --verbose      \
      --checksum     \
      --recursive    \
      --update       \
      --links        \
      --hard-links   \
      --perms        \
      --owner        \
      --group        \
      --times        \
      --delete       \
      --delete-after \
      --ipv4         \
      --progress     \
"

rsync $options /var/www     otherhost:/var
rsync $options /etc/httpd   otherhost:/etc
rsync $options /etc/php.ini otherhost:/etc

ssh   otherhost service httpd restart

-- 
Sometimes I wonder.  Were our faith able to stand upright and look around, would it be looking down at the mustard seed or standing in awe of the height and breadth of it.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3296 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://tfug.org/pipermail/tfug_tfug.org/attachments/20081016/651fa9e3/attachment-0002.bin>


More information about the tfug mailing list