Skip to content

Instantly share code, notes, and snippets.

@seikath
seikath / keybase.md
Created February 23, 2017 11:26
keybase.md

Keybase proof

I hereby claim:

  • I am seikath on github.
  • I am seikath (https://keybase.io/seikath) on keybase.
  • I have a public key ASBhq-7Yef7ONG72otzgbdujwksgdhma-fqnLSFlsnMMfAo

To claim this, I am signing this object:

@seikath
seikath / mysql-table-size-ondisk.sh
Last active October 21, 2015 12:06 — forked from shlomi-noach/mysql-table-size-ondisk.sh
Bash script to calculate MySQL table dimensions on disk
#!/bin/bash
(
# non reliable as some mysql instances are using custom config files
# mysql_datadir=$(grep -ir datadir /etc/my.cnf* | cut -d "=" -f 2 | cut -d "#" -f 1 | head -n 1)
# the following fix works only at started instances .. it uses the process list
mysql_datadir=$(ps ax | grep datadir | grep mysql | sed 's/^.*--datadir=//;s/ .*$//' | tail -1 )
cd $mysql_datadir
for frm_file in $(find . -name "*.frm" | egrep -v "[.]/(mysql|sys|performance_schema|common_schema)")
do
table_schema=$(echo $frm_file | cut -d "/" -f 2)