|
@@ -34,6 +34,7 @@ from .key import key_creator, RepoKey, PassphraseKey
|
|
|
from .keymanager import KeyManager
|
|
|
from .archive import backup_io, BackupOSError, Archive, ArchiveChecker, CHUNKER_PARAMS, is_special
|
|
|
from .remote import RepositoryServer, RemoteRepository, cache_if_remote
|
|
|
+from .platform import umount
|
|
|
|
|
|
has_lchflags = hasattr(os, 'lchflags')
|
|
|
|
|
@@ -539,6 +540,10 @@ class Archiver:
|
|
|
self.exit_code = EXIT_ERROR
|
|
|
return self.exit_code
|
|
|
|
|
|
+ def do_umount(self, args):
|
|
|
+ """un-mount the FUSE filesystem"""
|
|
|
+ return umount(args.mountpoint)
|
|
|
+
|
|
|
@with_repository()
|
|
|
def do_list(self, args, repository, manifest, key):
|
|
|
"""List archive or repository contents"""
|
|
@@ -1476,6 +1481,21 @@ class Archiver:
|
|
|
subparser.add_argument('-o', dest='options', type=str,
|
|
|
help='Extra mount options')
|
|
|
|
|
|
+ umount_epilog = textwrap.dedent("""
|
|
|
+ This command un-mounts a FUSE filesystem that was mounted with ``borg mount``.
|
|
|
+
|
|
|
+ This is a convenience wrapper that just calls the platform-specific shell
|
|
|
+ command - usually this is either umount or fusermount -u.
|
|
|
+ """)
|
|
|
+ subparser = subparsers.add_parser('umount', parents=[common_parser],
|
|
|
+ description=self.do_umount.__doc__,
|
|
|
+ epilog=umount_epilog,
|
|
|
+ formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
|
+ help='umount repository')
|
|
|
+ subparser.set_defaults(func=self.do_umount)
|
|
|
+ subparser.add_argument('mountpoint', metavar='MOUNTPOINT', type=str,
|
|
|
+ help='mountpoint of the filesystem to umount')
|
|
|
+
|
|
|
info_epilog = textwrap.dedent("""
|
|
|
This command displays some detailed information about the specified archive.
|
|
|
|