|
|
|
@ -36,8 +36,9 @@ class ProfileSyncer():
|
|
|
|
|
return check_port(self.hostname, self.port)
|
|
|
|
|
|
|
|
|
|
def create_process(self, source, target, *params):
|
|
|
|
|
#подключение к домену и синхрозизация
|
|
|
|
|
self.process = pexpect.spawn('/usr/bin/rsync',
|
|
|
|
|
['--rsh=/usr/bin/ssh -o "ControlMaster no" -p{port} {username}@{hostname}'.format(
|
|
|
|
|
['--rsh=/usr/bin/ssh -o "ControlMaster no" -o "StrictHostKeyChecking no" -p{port} {username}@{hostname}'.format(
|
|
|
|
|
port=self.port, hostname=self.hostname, username=self.username),
|
|
|
|
|
'--info=progress2'] + list(params) + [source, target])
|
|
|
|
|
|
|
|
|
@ -55,8 +56,9 @@ class ProfileSyncer():
|
|
|
|
|
def exists(self, filename):
|
|
|
|
|
env = dict(os.environ)
|
|
|
|
|
env["LANG"] = "C"
|
|
|
|
|
#подключение к домену и синхрозизация
|
|
|
|
|
self.process = pexpect.spawn('/usr/bin/rsync',
|
|
|
|
|
['--rsh=/usr/bin/ssh -o "ControlMaster no" -p{port} {username}@{hostname}'.format(
|
|
|
|
|
['--rsh=/usr/bin/ssh -o "ControlMaster no" -o "StrictHostKeyChecking no" -p{port} {username}@{hostname}'.format(
|
|
|
|
|
port=self.port, hostname=self.hostname, username=self.username),
|
|
|
|
|
'--list-only',
|
|
|
|
|
filename], env=env)
|
|
|
|
|