Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- MO="--lock-tables=false"
- P="/var/www/sql_dump/"
- echo "Removing old backups in ${P}"
- rm -f ${P}*.sql.gz
- echo
- # BASE TABLES
- echo "Dumping databases to ${P}"
- for DB in `mysql -N -B -e 'show databases'`
- do
- echo "\t${DB}"
- mysqldump $MO $DB | gzip > ${P}${DB}.sql.gz
- done
Add Comment
Please, Sign In to add comment