diff options
-rw-r--r-- | TODO.md | 1 | ||||
-rwxr-xr-x | share/hydractl/mysql-repair | 14 |
2 files changed, 15 insertions, 0 deletions
@@ -15,3 +15,4 @@ Hydractl - backup-restore-user and backup-restore-users. - hydractl backup-restore-site {debian,wiki}. - wrapper to import/export monkeysphere keys into keyringer. + - enhance mysql-repair diff --git a/share/hydractl/mysql-repair b/share/hydractl/mysql-repair new file mode 100755 index 0000000..00802c5 --- /dev/null +++ b/share/hydractl/mysql-repair @@ -0,0 +1,14 @@ +#!/bin/bash +# +# Quick and dirty database repair script! +# + +DAMAGED="`grep "Checking table" /var/log/daemon.log | cut -d "'" -f 2 | uniq`" + +for damage in $DAMAGED; do + db="`dirname $damage | sed -e 's|./||'`" + tb="`basename $damage`" + + echo "Fixing table $tb on db $db..." + echo "repair table $tb" | mysql $db +done |