CartMetrix - Do you know yours?

« Wordpress Revision History Plugin | Home | Combating Card Fraud (or at least slow it down) »

3/14/2007

Quick and Dirty MySQL Backup Script

I previously posted a Quick and Dirty MySQL Backup snippet that has gotten a bit of traffic. It works well in a pinch, but it doesn’t have any features. I use it primarily as a safety backup when performing maintenance on a MySQL server.

Several of my clients have requested a script that they can use to do on demand one-off backups. I rolled the snippet up into a very quick-and-dirty MySQL backup.

Download mysql_quick_back.sh

Installation

  1. Copy mysql_quick_back.sh to a directory in your path (~/bin/ for me).
  2. Set execute bits with
    chmod 755 mysql_quick_back.sh
  3. Set MySQL user/pass, directory to save backups to and notification email in script configuration
    # START configure
    # MySQL user, needs SELECT privileges
    # Create a new user with these permissions!  More secure than using a user
    # with full permissions
    user=

    # MySQL password
    pass=

    # admin email address
    adminemail=

    # backup location without trailing slash
    # set to current directory
    backuppath=.
    # or set to your home directory
    #backuppath=/home/admin/db_backs
     

Usage

Simply execute the script

NOTE

For a full MySQL backup application, check out the original MySQL Backup by Peter Falkenberg Brown. MySQL Backup is robust enough to use as a daily backup. I use it on most of the servers I manage.

Popularity: 20%

Trackback:

Related Posts

Post your opinion

Verification Image

Please type the letters you see in the picture.

Subscribe without commenting


damonparker.org is proudly powered by WordPress
Entries (RSS) and Comments (RSS).

copyright © 2002-2008 damonparker.org. all rights reserved.

Close
E-mail It