Oneliner to check InnoDB status in MySQL every second:

while sleep 1; do date >> /tmp/mysql_innodb_status_log && mysql -e "show engine innodb status\G;" >> /tmp/mysql_innodb_status_log; done

Simulate cron environment

Sometimes scripts aren’t working in cron, but they’re working manually. To debug them it’s helpful to simulate their running under cron environment.

add this to cron and let it to run at least once

* * * * * env > ~/cron_env

run this command to simulate environment:

env - `cat ~/cron_env` /bin/sh