When I look inside my Drupal 6 database on a Linux machine, I see that it is clutters with a bunch of very big *.BAK files, with names like cache_form-110416043841.BAK. I am wondering if I can safely delete them? And if deleting them is not recommended, what's their use?
Have a look at your /etc/my.cnf file and you’ll probably see this line:
myisam-recover = BACKUP
Or, if you're using a more recent version of MySQL:
myisam-recover-options = BACKUP
This is an option for the MyISAM storage engine. With recovery enabled, when MySQL starts up if it detects that a MyISAM table crashed or otherwise was not closed properly, it attempts to automatically recover the table. With the BACKUP option, it also creates this .BAK file of a copy of the table before it attempted recovery.
If everything seems to be running fine after a safe margin of time (30 days? YMMV), personally, I’d feel comfortable deleting the older .BAK files*, but if there are a lot of these over a span of time that continues to the present, I would probably try to identify the underlying problem that results in the failure of the tables being properly closed.
*The age of the BAK file can be determined by a simple stat command or by the timestamp encoded in the file’s name: table-YYMMDDHHMMSS.BAK
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With