MCPcopy
hub / github.com/borgbackup/borg / ssh_cmd

Method ssh_cmd

src/borg/remote.py:724–734  ·  view source on GitHub ↗

return a ssh command line that can be prefixed to a borg command line

(self, location)

Source from the content-addressed store, hash-verified

722 return env_vars + [remote_path, "serve"] + opts
723
724 def ssh_cmd(self, location):
725 """return a ssh command line that can be prefixed to a borg command line"""
726 rsh = self._args.rsh or os.environ.get("BORG_RSH", "ssh")
727 args = shlex.split(rsh)
728 if location.port:
729 args += ["-p", str(location.port)]
730 if location.user:
731 args.append(f"{location.user}@{location.host}")
732 else:
733 args.append("%s" % location.host)
734 return args
735
736 def call(self, cmd, args, **kw):
737 for resp in self.call_many(cmd, [args], **kw):

Callers 5

__init__Method · 0.95
test_remote_ssh_cmdFunction · 0.45
test_remote_borg_cmdFunction · 0.45
test_remote_ssh_cmdFunction · 0.45
test_remote_borg_cmdFunction · 0.45

Calls 1

getMethod · 0.45

Tested by 4

test_remote_ssh_cmdFunction · 0.36
test_remote_borg_cmdFunction · 0.36
test_remote_ssh_cmdFunction · 0.36
test_remote_borg_cmdFunction · 0.36