#!/bin/bash while : ; do mysql -B test -e "FLUSH TABLES WITH READ LOCK; UNLOCK TABLES" done