|
|
|
@ -545,9 +545,13 @@ def makeLsyncdConf(data): |
|
|
|
|
mw.writeFile(cmd_pass, t['password']) |
|
|
|
|
mw.execShell("chmod 600 " + cmd_pass) |
|
|
|
|
|
|
|
|
|
delete_ok = ' ' |
|
|
|
|
if t['delete'] == "true": |
|
|
|
|
delete_ok = ' --delete ' |
|
|
|
|
|
|
|
|
|
remote_addr = t['name'] + '@' + t['ip'] + "::" + t['name'] |
|
|
|
|
cmd = rsync_bin + " -avzP " + "--port=" + str(t['rsync']['port']) + " --bwlimit=" + t['rsync'][ |
|
|
|
|
'bwlimit'] + " --exclude-from=" + cmd_exclude + " --password-file=" + cmd_pass + " " + t["path"] + " " + remote_addr |
|
|
|
|
'bwlimit'] + delete_ok + " --exclude-from=" + cmd_exclude + " --password-file=" + cmd_pass + " " + t["path"] + " " + remote_addr |
|
|
|
|
mw.writeFile(name_dir + "/cmd", cmd) |
|
|
|
|
mw.execShell("cmod +x " + name_dir + "/cmd") |
|
|
|
|
|
|
|
|
|