I want to find the latest mysql binary log in /var/log/mysql/
, but I found the name of binlog is mariadb-bin.0000*
, and we also have mysql-bin.index
, so it's really hard for me to use shell script to distinguish them. My idea is finding binlogs by their file type, which is "Mysql replication log", then sort them by modification time, but I don't know how to do it.
Can anyone help me with that?