Difference between revisions of "backup mysql plesk server"

From WebHostingNeeds.com
Jump to: navigation, search
(Created page with "<pre> [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" |...")
 
(No difference)

Latest revision as of 19:07, 8 December 2017

[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