• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • 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.

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