• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved CLI: mySQL dump

omexlu

Regular Pleskian
Hello,

Is there any way to dump individual mySQL-Databases trought the CLI (command line) and put them to a specific path?

Thanks in advance.
 
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin DATABASE_NAME > /full/path/to/BACKUP_FILE_NAME.sql
 
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin DATABASE_NAME > /full/path/to/BACKUP_FILE_NAME.sql

Thank you, i wan't to use this in a bash script.

Other questions is now how can i disable multipledomains in one commande in the time where the backup is made?

Thanks in advance.
 
Other questions is now how can i disable multipledomains in one commande in the time where the backup is made?
You can try to use something like

# for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains"`; do /usr/local/psa/bin/subscription --suspend $i; done

For choosing specific domains you can modify SQL query "select name from domains" according to your needs.
 
For a compressed backup:

MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin DATABASE_NAME | bzip2 -9 > /full/path/to/BACKUP_FILE_NAME.sql.bz2

or

MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin DATABASE_NAME | gzip -9 > /full/path/to/BACKUP_FILE_NAME.sql.gz
 
Back
Top