Skip to content

Instantly share code, notes, and snippets.

@christo16
Created December 20, 2010 11:34
Show Gist options
  • Save christo16/748279 to your computer and use it in GitHub Desktop.
Save christo16/748279 to your computer and use it in GitHub Desktop.
mysqldump script
#mysql info
HOST=127.0.0.1
USER=root
PASS=1234
DB=database
#gzip which
GZIP="$(which gzip)"
# Get data in dd-mm-yyyy format
NOW="$(date +"%d-%m-%Y")"
#file name
FILE="/backup/acn_prod.$NOW.gz"
mysqldump --opt --user=$USER --password=$PASS --host=$HOST $DB | $GZIP -9 > $FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment