难点在于solusvm被控端已经开了小鸡的情况。

备份数据库:

#!/bin/sh

## Vars
CONF=/usr/local/solusvm/includes/solusvm.conf
FILENAME=solusvm_database_dump.gz ## Get the database details
DN=`grep -m1 $: ${CONF} | cut -d ':' -f `;
DU=`grep -m1 $: ${CONF} | cut -d ':' -f `;
DP=`grep -m1 $: ${CONF} | cut -d ':' -f `; ## 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 $: ${CONF} | cut -d ':' -f `;
DU=`grep -m1 $: ${CONF} | cut -d ':' -f `;
DP=`grep -m1 $: ${CONF} | cut -d ':' -f `; ## Do the dump
echo "Restoring database..."
mysql --user=${DU} --password=${DP} ${DN} < ~/${FILENAME};
echo "Complete."

注意恢复数据库后,重新到界面对node,更新其key password。

顺便改进下,做个快键键登录连接数据库:

!/bin/sh

## Vars
CONF=/usr/local/solusvm/includes/solusvm.conf ## Get the database details
DN=`grep -m1 $: ${CONF} | cut -d ':' -f `;
DU=`grep -m1 $: ${CONF} | cut -d ':' -f `;
DP=`grep -m1 $: ${CONF} | cut -d ':' -f `; mysql --user=${DU} --password=${DP} ${DN};

最新文章

  1. Centos 7 开启端口
  2. Spring boot学习一
  3. ORA-1034 ORACLE not available (转)
  4. 解决项目中.a文件的冲突
  5. Winform文件下载之WebClient
  6. [bug] 未能加载文件或程序集“SIPEPS, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一个依赖项。系统找不到指定的文件。
  7. HD1532Drainage Ditches(最大流模板裸题 + 邻接表)
  8. poj2996 模拟
  9. Failed to connect to remote VM. Connection refused. Connection refused: connect.
  10. 将数组之中的省份市区地区ID改成对用中文字符
  11. Mac中MacPorts安装和使用
  12. tomcat容器启动的启动过程(三)
  13. npm install含义 及vue安装启动项目时报错解决及vue建项目时各文件间的依赖关系
  14. SaberRD之瞬态分析
  15. Git命令以及常见注意事项
  16. js三种经典排序:冒泡排序、插入排序、快速排序
  17. 梯度下降法原理与python实现
  18. [转]C++编译链接过程详解
  19. Map、Set、List 集合 差别 联系
  20. 查看docker容器日志

热门文章

  1. 《转》python 12 列表解析
  2. CSV导入到hive中,处理分号问题
  3. JQuery Ajax 向后台传参方式
  4. windows 嵌入控制台
  5. SSE:服务器推送事件
  6. day25 模块,sys, logging, json, pickle
  7. TopCoder[SRM513 DIV 1]:Reflections(1000)
  8. python和go对比字符串的链式处理
  9. UML之类图、时序图、用例图 粗略版介绍
  10. 云时代IDC自动化运维的几大神器