Am 01.02.2011 23:26, schrieb Larry H.:

> I ended up getting my databases back in sync the old fashion way. Stopped all
> dbmail services, setting incoming mail to queue up and mysqldump. I ran in
> to all kinds of issues starting my slave back up after the rsync. Maybe I
> was using the wrong switches in rsync, not sure

The following script i'm using since a long time to re-init dbmail-replication
which makes a backup on the local server and after all mail-services are running
again i can do another rsync to the slave while the master writes his changes
to the binlog

* first rsync while all services are running to warm-up the backup
* stop all service in the right order
* delete all binlogs from the master
* second rsync to get the last changes
* start all servcies in the right order

IMPORTANT:
The slave should be stopped before that is running, maybe
you forgot this and stopping the slave chnaged timestamps
to newer as on the master-backup, one time i had problems
because of this

REMEMBER:
* at the begin the backup-folder on the master should be empty
* to get 100% safe delete all files on the slave before rsync

This works for 8 mysql-instances (not only dbmail) since a lomg
time and is placed in PATH as "mysql_init-Backup.sh" and has
to be called as "mysql_init_backup.sh really", without the
param it would stop after the first rsync

__________________________

#!/bin/bash

rsync --times --perms --owner --group --recursive --delete-after 
/Volumes/dune/mysql_data/ /Volumes/dune/mysql_backup/

if ([ "$1" != "really" ])
 then
  echo "Please call with param 'really' to prevent mistakes"
  exit
fi

/sbin/service crond stop
/sbin/service postfix stop
/sbin/service dovecot stop
/sbin/service dbmail-imapd stop
/sbin/service dbmail-lmtpd stop
/sbin/service dbmail-pop3d stop
/sbin/service dbmail-timsieved stop
/sbin/service mysqld stop

cd /Volumes/dune/mysql_data/
rm -f /Volumes/dune/mysql_data/bin*

rsync --progress --times --perms --owner --group --recursive --delete-after 
/Volumes/dune/mysql_data/
/Volumes/dune/mysql_backup/

/sbin/service mysqld start
/sbin/service dbmail-lmtpd start
/sbin/service dovecot start
/sbin/service postfix start
/sbin/service dbmail-imapd start
/sbin/service dbmail-pop3d start
/sbin/service dbmail-timsieved start
/sbin/service crond start

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
DBmail mailing list
[email protected]
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail

Reply via email to