标签:conf details use get class pre bin svm name
难点在于solusvm被控端已经开了小鸡的情况。
备份数据库:
#!/bin/sh ## Vars CONF=/usr/local/solusvm/includes/solusvm.conf FILENAME=solusvm_database_dump.gz ## Get the database details DN=`grep -m1 $1: ${CONF} | cut -d ‘:‘ -f 1`; DU=`grep -m1 $1: ${CONF} | cut -d ‘:‘ -f 2`; DP=`grep -m1 $1: ${CONF} | cut -d ‘:‘ -f 3`; ## Do the dump echo "Dumping database..." mysqldump --opt -h localhost --user=${DU} --password=${DP} ${DN} > ~/${FILENAME}; echo "Complete."
新主动端恢复数据库:
#!/bin/sh ## Vars CONF=/usr/local/solusvm/includes/solusvm.conf FILENAME=solusvm_database_dump.gz ## Get the database details DN=`grep -m1 $1: ${CONF} | cut -d ‘:‘ -f 1`; DU=`grep -m1 $1: ${CONF} | cut -d ‘:‘ -f 2`; DP=`grep -m1 $1: ${CONF} | cut -d ‘:‘ -f 3`; ## Do the dump echo "Restoring database..." mysql --user=${DU} --password=${DP} ${DN} < ~/${FILENAME}; echo "Complete."
标签:conf details use get class pre bin svm name
原文地址:https://www.cnblogs.com/zhenfei/p/10422353.html