#!/bin/bash set -ue q25="SELECT table_schema AS db, SUM( data_length + index_length ) AS db_size_bytes FROM information_schema.TABLES WHERE table_schema NOT IN ('performance_schema', 'information_schema', 'mysql') GROUP BY 1" while true; do sleep ${s:-30} date mysql -D information_schema -e "$q25 ;" > /dev/null done