Created
January 14, 2010 11:48
-
-
Save craigw/277099 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# make sure /etc/mysql.passwd is chmod go-wrx. | |
# and chmod root:root. | |
PASSWORD=`cat /etc/mysql.passwd` | |
NICE='/usr/bin/nice -n 20' | |
CWD=`/bin/pwd` | |
UMASK=`umask` | |
MYSQLDUMP="/usr/bin/mysqldump -u root --password='${PASSWORD}'" | |
DUMPFILE="/var/backups/mysql.sql" | |
umask u=r,go-wrx | |
$NICE $MYSQLDUMP --all-databases > ${DUMPFILE} | |
umask $UMASK |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment