• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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