From f8a29027870060d5f8ac643ac3fb702e671c2aa0 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 5 Feb 2021 16:52:05 +0800 Subject: [PATCH] Update index.py --- plugins/mysql/index.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index edf0ee225..cca43fadf 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -1493,9 +1493,8 @@ def dumpMysqlData(version): pwd = pSqliteDb('config').where('id=?', (1,)).getField('mysql_root') - # print getServerDir() cmd = getServerDir() + "/bin/mysqldump -uroot -p" + \ - pwd + " --databases " + dlist.join(',') + \ + pwd + " --databases " + ','.join(dlist) + \ " > /tmp/dump.sql" ret = mw.execShell(cmd) @@ -1515,7 +1514,6 @@ def async(f): return wrapper -@async def doFullSync(db): status_file = '/tmp/db_async_status.txt' @@ -1529,6 +1527,7 @@ def doFullSync(db): ssh.load_system_host_keys() ssh.connect(hostname='8.210.55.220', port=22, username='root', pkey=key) cmd = "cd /www/server/mdserver-web && python /www/server/mdserver-web/plugins/mysql/index.py dump_mysql_data {\"db\":'" + db + "'} " + print cmd stdin, stdout, stderr = ssh.exec_command(cmd) result = stdout.read() result_err = stderr.read()