Update index.py

pull/579/head
Mr Chen 12 months ago
parent 9b9a806dee
commit 2bd607edad
  1. 13
      plugins/mariadb/index.py

@ -2647,6 +2647,12 @@ def doFullSync(version=''):
def doFullSyncUser(version=''):
which_pv = mw.execShell('which pv')
is_exist_pv = False
if not os.path.exists(which_pv[0]):
is_exist_pv = True
args = getArgs()
data = checkArgs(args, ['db', 'sign'])
if not data[0]:
@ -2708,6 +2714,13 @@ def doFullSyncUser(version=''):
if os.path.exists(bak_file):
pwd = pSqliteDb('config').where('id=?', (1,)).getField('mysql_root')
sock = getSocketFile()
if is_exist_pv:
my_import_cmd = getServerDir() + '/bin/mariadb -S ' + sock + " -uroot -p'" + pwd + "' " + sync_db
my_import_cmd = "pv -t -p " + bak_file + '|' + my_import_cmd
print(my_import_cmd)
os.system(my_import_cmd)
else:
my_import_cmd = getServerDir() + '/bin/mariadb -S ' + sock + " -uroot -p'" + pwd + \
"' " + sync_db + '<' + bak_file
print(my_import_cmd)

Loading…
Cancel
Save