2017-05-16 41 views
0

我的Couchbase密码包含括号,并导致cbbackupwrapper出现问题(虽然cbbackup可以正常工作)。cbbackupwrapper不能与包含括号的密码一起使用

这是我运行命令: cbbackupwrapper http://HOST:8091 /备份-DIR --username管理员--password 'XXXX(XXXXXXXX' --mode DIFF --bucket源BUCKET_NAME --single节点

这是输出:?

Waiting for the backup to complete... 
/bin/sh: 1: Syntax error: "(" unexpected 
/bin/sh: 1: Syntax error: "(" unexpected 
/bin/sh: 1: Syntax error: "(" unexpected 
/bin/sh: 1: Syntax error: "(" unexpected 
/bin/sh: 1: Syntax error: "(" unexpected 
/bin/sh: 1: Syntax error: "(" unexpected 
/bin/sh: 1: Syntax error: "(" unexpected 
/bin/sh: 1: Syntax error: "(" unexpected 
/bin/sh: 1: Syntax error: "(" unexpected 
/bin/sh: 1: Syntax error: "(" unexpected 
/bin/sh: 1: Syntax error: "(" unexpected 
SUCCESSFULLY COMPLETED! 

不用多说了备份完成得太快,无法成功完成

想法吗

回答

1

这似乎是一个Python脚本中的错误,它应该在构建命令行时引用密码(也可能是其他参数)。这个补丁修复了这个问题:

--- /opt/couchbase/lib/python/cbbackupwrapper.orig 2017-05-16 11:03:36.045523102 +0300 
+++ /opt/couchbase/lib/python/cbbackupwrapper 2017-05-16 11:04:08.427692842 +0300 
@@ -17,6 +17,7 @@ 
import threading 
import time 
import urllib2 
+import pipes 

"""Written by Daniel Owen [email protected] on 27 June 2014 
Version 1.4 Last updated 10 July 2014 
@@ -356,7 +357,7 @@ 
     command_line = '"' + os.path.join(path, backup_exe) + '"' + ' -v -t 1 --vbucket-list=' \ 
      + ''.join(str(chunk).split()) + ' http://' + node + ':' + rest + ' ' \ 
      + '"' + os.path.join(backupDir, vbucketsname) + '"' + ' -u ' + args.username \ 
-   + ' -p ' + args.password + extra_options + mode_options + ssl_option + specific_bucket \ 
+   + ' -p ' + pipes.quote(args.password) + extra_options + mode_options + ssl_option + specific_bucket \ 
      + ' 2> ' + '"' + os.path.join(backupDir, 'logs', vbucketsname) + '.err' + '"' 
     process_queue.put(command_line) 
+0

工作完美。谢谢! – yosi1984

相关问题