backup mysql plesk server

From WebHostingNeeds.com
Jump to: navigation, search
[email protected]:~# cat /root/mysqldb-backup.sh
#!/bin/bash
mysql -uadmin -p`cat /etc/psa/.psa.shadow` -e "show databases" | grep -v "+-------------" | grep -v "Database" | grep -v "information_schema" | grep -v "performance_schema" > /tmp/dbs_list.txt
for db in `cat /tmp/dbs_list.txt`
do
	/usr/bin/mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` $db > /mysql-backup/$db.sql
done
[email protected]:~# 




mysql backup