• 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
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

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