summaryrefslogtreecommitdiff
path: root/lbup
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-10-12 18:58:49 +0200
committerAnton Khirnov <anton@khirnov.net>2023-10-12 18:58:49 +0200
commitdc52f123745748ee61e894fe36eeca1788fc4ed8 (patch)
tree7c849c940ade7f969198d65dec682c449c9b69f7 /lbup
parent115c94aeaa0c1a5a99b895b58c1640bfb8b4e7e8 (diff)
targets:TargetSSHLVM: add strip_mountpoint option
Diffstat (limited to 'lbup')
-rw-r--r--lbup/targets.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/lbup/targets.py b/lbup/targets.py
index 55702ee..37a58f0 100644
--- a/lbup/targets.py
+++ b/lbup/targets.py
@@ -246,9 +246,13 @@ class TargetSSHLVM(TargetSSH):
"""
_mntns_pid = None
+ _strip_mountpoint = None
+
def __init__(self, name, dirs, excludes = None, logger = None,
- remote = None, remote_bupdir = None, snapshot_size = '20G'):
+ remote = None, remote_bupdir = None, snapshot_size = '20G',
+ strip_mountpoint = False):
self._snapshot_size = snapshot_size
+ self._strip_mountpoint = strip_mountpoint
super().__init__(name, dirs, excludes, logger, remote, remote_bupdir)
@@ -377,7 +381,7 @@ class TargetSSHLVM(TargetSSH):
bup_exec = ['bup', 'on', '%s@%s' % (self._remote.username, self._remote.host),
'-d', str(bupdir)]
- save_opts = ['--graft=%s=%s' % (snapshot_mount, mountpoint)]
+ save_opts = ['--graft=%s=%s' % (snapshot_mount, '/' if self._strip_mountpoint else mountpoint)]
index_opts = ['--no-check-device']
reparent = (mountpoint, AbsPath(snapshot_mount))
dirs = [str(d.reparent(*reparent)) for d in dirs]