Skip to content

Instantly share code, notes, and snippets.

@shillcock
Created January 24, 2009 04:47
Show Gist options
  • Select an option

  • Save shillcock/51338 to your computer and use it in GitHub Desktop.

Select an option

Save shillcock/51338 to your computer and use it in GitHub Desktop.
#!/bin/sh
# shell script to backup a mysql database
RM=/bin/rm
MV=/bin/mv
TAR=/bin/tar
GZIP=/bin/gzip
CHOWN=/bin/chown
DUMP=/usr/bin/mysqldump
BDIR=/mnt/mrynas/backups/fogbugz
DATE=`date +%Y%m%d`
echo Dumping mysql database as
echo $BDIR/mysql.$DATE.gz
$DUMP --opt -c -e -Q mysql | gzip > $BDIR/mysql.$DATE.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment