mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-27 02:08:54 +00:00
Merge pull request #134 from ThomasWaldmann/remotepath
implement --remote-path to allow non-default-path borg locations
This commit is contained in:
commit
741715cd0e
2 changed files with 5 additions and 2 deletions
|
@ -512,6 +512,8 @@ def run(self, args=None):
|
|||
common_parser.add_argument('--no-files-cache', dest='cache_files', action='store_false')
|
||||
common_parser.add_argument('--umask', dest='umask', type=lambda s: int(s, 8), default=0o077, metavar='M',
|
||||
help='set umask to M (local and remote, default: 0o077)')
|
||||
common_parser.add_argument('--remote-path', dest='remote_path', default='borg', metavar='PATH',
|
||||
help='set remote path to executable (default: "borg")')
|
||||
|
||||
# We can't use argparse for "serve" since we don't want it to show up in "Available commands"
|
||||
if args:
|
||||
|
@ -823,6 +825,7 @@ def run(self, args=None):
|
|||
args = parser.parse_args(args or ['-h'])
|
||||
self.verbose = args.verbose
|
||||
set_umask(args.umask)
|
||||
RemoteRepository.remote_path = args.remote_path
|
||||
update_excludes(args)
|
||||
return args.func(args)
|
||||
|
||||
|
|
|
@ -108,9 +108,9 @@ def open(self, path, create=False):
|
|||
|
||||
class RemoteRepository:
|
||||
extra_test_args = []
|
||||
remote_path = None
|
||||
|
||||
class RPCError(Exception):
|
||||
|
||||
def __init__(self, name):
|
||||
self.name = name
|
||||
|
||||
|
@ -136,7 +136,7 @@ def __init__(self, location, create=False):
|
|||
args.append('%s@%s' % (location.user, location.host))
|
||||
else:
|
||||
args.append('%s' % location.host)
|
||||
args += ['borg', 'serve'] + umask
|
||||
args += [self.remote_path, 'serve'] + umask
|
||||
self.p = Popen(args, bufsize=0, stdin=PIPE, stdout=PIPE)
|
||||
self.stdin_fd = self.p.stdin.fileno()
|
||||
self.stdout_fd = self.p.stdout.fileno()
|
||||
|
|
Loading…
Reference in a new issue