diff -Nur -x '*.orig' -x '*.rej' e-smith-mysql-1.12.0/createlinks mezzanine_patched_e-smith-mysql-1.12.0/createlinks --- e-smith-mysql-1.12.0/createlinks 2006-03-15 23:44:28.000000000 -0700 +++ mezzanine_patched_e-smith-mysql-1.12.0/createlinks 2006-12-27 20:23:55.000000000 -0700 @@ -39,6 +39,9 @@ templates2events("$_", $event); } +# Move all database dumps except for mysql.dump to sql/init +event_link("mysql-load-tables", $event, "40"); + #-------------------------------------------------- # actions for timezone-update event #-------------------------------------------------- diff -Nur -x '*.orig' -x '*.rej' e-smith-mysql-1.12.0/root/etc/e-smith/events/actions/mysql-delete-dumped-tables mezzanine_patched_e-smith-mysql-1.12.0/root/etc/e-smith/events/actions/mysql-delete-dumped-tables --- e-smith-mysql-1.12.0/root/etc/e-smith/events/actions/mysql-delete-dumped-tables 2006-03-15 23:44:28.000000000 -0700 +++ mezzanine_patched_e-smith-mysql-1.12.0/root/etc/e-smith/events/actions/mysql-delete-dumped-tables 2006-12-27 20:23:30.000000000 -0700 @@ -1,3 +1,3 @@ #!/bin/sh -exec /bin/rm -f /home/e-smith/db/mysql/mysql.dump +exec /bin/rm -f /home/e-smith/db/mysql/*.dump diff -Nur -x '*.orig' -x '*.rej' e-smith-mysql-1.12.0/root/etc/e-smith/events/actions/mysql-dump-tables mezzanine_patched_e-smith-mysql-1.12.0/root/etc/e-smith/events/actions/mysql-dump-tables --- e-smith-mysql-1.12.0/root/etc/e-smith/events/actions/mysql-dump-tables 2006-12-27 20:25:59.000000000 -0700 +++ mezzanine_patched_e-smith-mysql-1.12.0/root/etc/e-smith/events/actions/mysql-dump-tables 2006-12-27 20:23:30.000000000 -0700 @@ -6,5 +6,7 @@ echo "mysqld is disabled - no tables dumped" >&2 exit 0 fi -exec >/home/e-smith/db/mysql/mysql.dump -exec /usr/bin/mysqldump --add-drop-table -A -Q +for db in $(mysql -BNre "show databases;") +do + mysqldump --add-drop-table -QB "$db" -r /home/e-smith/db/mysql/"$db".dump || exit 1 +done diff -Nur -x '*.orig' -x '*.rej' e-smith-mysql-1.12.0/root/etc/e-smith/events/actions/mysql-load-tables mezzanine_patched_e-smith-mysql-1.12.0/root/etc/e-smith/events/actions/mysql-load-tables --- e-smith-mysql-1.12.0/root/etc/e-smith/events/actions/mysql-load-tables 1969-12-31 17:00:00.000000000 -0700 +++ mezzanine_patched_e-smith-mysql-1.12.0/root/etc/e-smith/events/actions/mysql-load-tables 2006-12-27 20:25:18.000000000 -0700 @@ -0,0 +1,15 @@ +#!/bin/sh + +status=$(/sbin/e-smith/config getprop mysqld status) +if [ "$status" = "disabled" ] +then + echo "mysqld is disabled - no tables restored" >&2 + exit 0 +fi +if [ ! -f /var/lib/mysql/mysql/user.frm ] +then + for db in $(ls /home/e-smith/db/mysql/*.dump 2> /dev/null | grep -v '/mysql.dump') + do + mv $db /etc/e-smith/sql/init/01_$(basename $db .dump).sql + done +fi