Files
Thomas WaldmannandClaude Opus 5.5 c7f2f2d8ce mount: add archive_dir_format mount option
Same as BORG_MOUNT_ARCHIVE_DIR_FORMAT, but usable from fstab and autofs
entries; if both are given, the mount option is used. As mount options
are separated by commas, the format can not contain a comma.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 11:10:08 +02:00

64 lines
2.2 KiB
ReStructuredText

.. include:: mount.rst.inc
.. include:: umount.rst.inc
Examples
~~~~~~~~
::
# Mounting the repository shows all archives (here: two archives of the series
# "root", the short archive id is appended to make the directory names unique).
# Archives are loaded lazily, expect some delay when navigating to an archive
# for the first time.
$ borg mount /tmp/mymountpoint
$ ls /tmp/mymountpoint
root-1f7b3c2a root-9e4d0b58
$ borg umount /tmp/mymountpoint
# BORG_MOUNT_ARCHIVE_DIR_FORMAT names the archive directories differently,
# using the placeholders of "borg repo-list --format":
$ BORG_MOUNT_ARCHIVE_DIR_FORMAT='{name}-{time:%Y-%m-%d}' borg mount /tmp/mymountpoint
$ ls /tmp/mymountpoint
root-2016-02-14 root-2016-02-15
$ borg umount /tmp/mymountpoint
# The archive_dir_format mount option does the same, e.g. for fstab / autofs entries:
$ borg mount -o 'archive_dir_format={name}-{time:%Y-%m-%d}' /tmp/mymountpoint
# The "versions view" merges all archives in the repository
# and provides a versioned view on files.
$ borg mount -o versions /tmp/mymountpoint
$ ls -l /tmp/mymountpoint/home/user/doc.txt/
total 47
-rw-r--r-- 1 user group 12167 Aug 28 23:14 doc.00001.txt
-rw-r--r-- 1 user group 11444 Aug 28 23:15 doc.00002.txt
$ borg umount /tmp/mymountpoint
# Archive filters are supported.
# These are especially handy for the "versions view",
# which does not support lazy processing of archives.
$ borg mount -o versions --match-archives 'sh:*-my-home' --last 10 /tmp/mymountpoint
# Exclusion options are supported.
# These can speed up mounting and lower memory needs significantly.
$ borg mount -r /path/to/repo /tmp/mymountpoint only/that/path
$ borg mount --exclude '...' /tmp/mymountpoint
borgfs
++++++
::
$ echo '/mnt/backup /tmp/myrepo fuse.borgfs defaults,noauto 0 0' >> /etc/fstab
$ mount /tmp/myrepo
$ ls /tmp/myrepo
root-2016-02-01 root-2016-02-15
.. Note::
``borgfs`` will be automatically provided if you used a distribution
package or ``pip`` to install Borg. Users of the standalone binary will have
to manually create a symlink (see :ref:`pyinstaller-binary`).