Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- USER="abc"
- PASSWORD=""
- ExcludeDatabases="Database|information_schema|performance_schema|mysql"
- databases=`mysql -u $USER -p$PASWORD -e "SHOW DATABASES;" | tr -d "| " | egrep -v $ExcludeDatabases`
- for db in $databases; do
- echo "Dumping database: $db"
- mysqldump -u $USER -p$PASSWORD --databases $db > `date +%Y%m%d`.$db.sql
- done
- #run this code in command line: /bin/sh all_db_backup.sh
- #make sure you are in the directory in which you want to store the files, before running the script
Add Comment
Please, Sign In to add comment