Shell Script to Backup MySQL Database
This is the shell script code to dump and compress a single MySQL database.
#!/bin/sh
today=$(date +'%Y-%m-%d')
mysqldump -v --single-transaction --user=**** --password=**** databasename | gzip -c > dbdump_$today.gz