expressgy 2 years ago
parent e9b627551e
commit 861b720fc6
  1. 17
      server.js

@ -63,23 +63,24 @@ function back(){
// 开始备份数据库 // 开始备份数据库
function startBackSQL(){ function startBackSQL(){
for(let item in DATABASELIST){
const i = DATABASELIST[item];
console.log(i)
// 数据库信息 // 数据库信息
let host = "localhost" let host = "localhost", user = "root", passwd = "root", database = i
, user = "root" runBackFunc(host, user, passwd, database)
, passwd = "root" }
, database = "develop" }
function runBackFunc(host, user, passwd, database){
backSQL(host, user, passwd, database) backSQL(host, user, passwd, database)
const outTime = getT() - new Date().getTime() const outTime = getT() - new Date().getTime()
for(let item in DATABASELIST){
const i = DATABASELIST[item];
database = i;
setTimeout(() => { setTimeout(() => {
setInterval(() => { setInterval(() => {
backSQL(host, user, passwd, database) backSQL(host, user, passwd, database)
}, 1000 * 60 * mintues) }, 1000 * 60 * mintues)
},outTime) },outTime)
} }
}
/** /**
* 根据系统类型读取编码格式 * 根据系统类型读取编码格式
* */ * */

Loading…
Cancel
Save