Last Updated: February 25, 2016
·
4.157K
· devopstom

Tailing MySQL Binary Log

export D=$(date +"%Y-%m-%d %H:%M:%S" --date="30 minutes ago"); watch "mysqlbinlog --start-datetime=\"$D\" mysql-bin.000040|tail"

2 Responses
Add your response

Can you explain what this does?

over 1 year ago ·

It runs mysqlbinlog with 30 minutes ago (that's what the D variable and --start-datetime does). Then it watches mysqlbinlog rerunning every two seconds and tailing the output.

over 1 year ago ·