How to backup mysql databases : mysql_backup

I have a couple databases in mysql on my machines (either for stuff like my weblog or more serious applications like for work ;). The machines are probably backed-up regularly using file-system-based tools… so I suppose that my database is backed-up once in a while if it is stored somewhere in /var/lib/mysql…

However, if for some reason the mysql server crashed, and had a problem opening the “raw” backup (maybe no longer backward-compatible after un upgrade), it would be difficult to get back my data…

The idea is to complement the raw backup with one of the data in “full-text”. mysqldump can be used to do so.

I found the mysql_backup(.pl) script developped by Peter Falkenberg Brown really useful. This GPL’ed tool handles the backup of selected mysql databases into files (one for each table), which are then compressed (.tar.gz) and named after the date of the backups, then rotated ala logrotate (btw, for uses of logrotate for similar needs, see this post by benj). It’s easily setup and configured with many options. A must-have in my opinion.

Thought I had blogged about it before… but it seems that I did not 😉

Update 2008/04/15 : Btw, if you can’t access the database directly, but have phpMyAdmin available, see the linked post in the trackbacks of this post for a tool I wrote.

Debian GNU/Linux on a Dell latitude D610 laptop

Again, I’ve tried and install a Debian distro on one of my collegues’ laptop, which is a Dell Latitude D610.

The process is similar to the one for a D510 I’ve described earlier.

Ony that this time, the 2.6.12 is available in testing, which removes the need to get things from unstable.

It seems that the SATA drives will be recognised by default without having to hange the /etc/modules or /etc/mkinitrd/modules config files : just apply the following steps :

  1. Install kernel 2.6.12 from testing
  2. Boot with the root=/dev/sdX option instead of root=/dev/hdX
  3. edit /etc/fstab, /boot/grub/menu.lst, etc.

Still, there are problems once it’s all installed : :

  • the suspend to ram doesn’t seem to be working as I expect it : although I configured some acpid event handler, after an “echo 3 > /proc/acpi/sleep” in the lid close handler, it will not resume OK : the disk seems to be working on and on, and the machine is frozen.

    This seems to be a common issue for other persons using this model. I’ve read that the problem relates to libata missing a suspend possibility (at least in kernel 2.6.12 – Cf. http://groups.yahoo.com/group/linux-dell-laptops/message/27234).

  • The CD drive is not recognized allright. To change that, the initrd should be rebuilt by appliying the following steps :
    • Modify the /etc/modules files in order to ask for the following modules in that order :
      scsi_mod
      sd_mod
      libata
      sata_sil
      piix
      ide-generic
      ata_piix
    • Modify the /etc/mkinitrd/modules file as well to provide the same list of modules
    • regenerate the initrd files using something like mkinitrd -o /boot/initrd.img-2.6.12-1-686 2.6.12-1-686.

Suspending
The suspend2disk is supposed to work, but I think it’s a bit too difficult to setup for the time being.

In the meantime, I think something can be done with the battery saving in case of lid closed with radeontool which can switch off the lid. See the acpid script here http://da.gentoo-wiki.com/HARDWARE_Dell_Latitude_D610#ACPI (paths should be adapted for Debian).
Still experimenting on that machine, so don’t take all these informations for exact.