MCPcopy Index your code
hub / github.com/borgbackup/borg / ssh_cmd

Method ssh_cmd

src/borg/legacyremote.py:426–436  ·  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

424 return env_vars + [remote_path, "serve"] + opts
425
426 def ssh_cmd(self, location):
427 """return a ssh command line that can be prefixed to a borg command line"""
428 rsh = self._args.rsh or os.environ.get("BORG_RSH", "ssh")
429 args = shlex.split(rsh)
430 if location.port:
431 args += ["-p", str(location.port)]
432 if location.user:
433 args.append(f"{location.user}@{location.host}")
434 else:
435 args.append("%s" % location.host)
436 return args
437
438 def call(self, cmd, args, **kw):
439 for resp in self.call_many(cmd, [args], **kw):

Callers 1

__init__Method · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected