choose a job you love & you will never have 2 work a day in your life

Backup All mysql Databases in Plesk

After painful many years of server migrations for clients, finally found a single line script online for dumping all databases. I made a minor modification for Plesk so that it can take the encrypted password from Plesk and pass it to mysql.

It finds all the databases in your Plesk install and dumps them each into individual gzipped file.

for I in $(mysql -uadmin -p`cat /etc/psa/.psa.shadow` -e 'show databases' -s --skip-column-names); do mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` $I | gzip > "$I.sql.gz"; done

Previous

New Year Eve in Paris

Next

Smart Tennis Gear

1 Comment

  1. admin

    This Post is helpful

Leave a Reply

Powered by WordPress & Theme by Anders Norén