Take a look at your /etc/my.cnf file and you will probably see this line:
myisam-recover = BACKUP
Or if you are using a newer version of MySQL:
myisam-recover-options = BACKUP
This is an option for the MyISAM storage engine. When recovery is turned on, when MySQL starts, if it detects that the MyISAM table crashed or was not closed correctly, it tries to automatically restore the table. With the BACKUP option, it also creates this .BAK copy of the table before attempting recovery.
If everything seems to be working fine after a safe period of time (30 days? YMMV), personally, Id feel comfortable deleting the old .BAK files *, but if there are a lot of them over a certain period of time, it continues to date, I probably I will try to identify the main problem that will lead to the failure of properly closed tables.
* The age of the BAK file can be determined by a simple stat command or a time stamp encoded in the file name: table-YYMMDDHHMMSS.BAK
source share