2017-05-16 70 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

相關問題