faq.rst 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157
  1. .. include:: global.rst.inc
  2. .. highlight:: none
  3. .. _faq:
  4. Frequently asked questions
  5. ==========================
  6. Usage & Limitations
  7. ###################
  8. What is the difference between a repo on an external hard drive vs. repo on a server?
  9. -------------------------------------------------------------------------------------
  10. If Borg is running in client/server mode, the client uses SSH as a transport to
  11. talk to the remote agent, which is another Borg process (Borg is installed on
  12. the server, too). The Borg server is doing storage-related low-level repo
  13. operations (get, put, commit, check, compact), while the Borg client does the
  14. high-level stuff: deduplication, encryption, compression, dealing with
  15. archives, backups, restores, etc., which reduces the amount of data that goes
  16. over the network.
  17. When Borg is writing to a repo on a locally mounted remote file system, e.g.
  18. SSHFS, the Borg client only can do file system operations and has no agent
  19. running on the remote side, so *every* operation needs to go over the network,
  20. which is slower.
  21. Can I backup from multiple servers into a single repository?
  22. ------------------------------------------------------------
  23. Yes, this is *possible* from the technical standpoint, but it is
  24. *not recommended* from the security perspective. |project_name| is
  25. built upon a defined :ref:`attack_model` that cannot provide its
  26. guarantees for multiple clients using the same repository. See
  27. :ref:`borg_security_critique` for a detailed explanation.
  28. Also, in order for the deduplication used by |project_name| to work, it
  29. needs to keep a local cache containing checksums of all file
  30. chunks already stored in the repository. This cache is stored in
  31. ``~/.cache/borg/``. If |project_name| detects that a repository has been
  32. modified since the local cache was updated it will need to rebuild
  33. the cache. This rebuild can be quite time consuming.
  34. So, yes it's possible. But it will be most efficient if a single
  35. repository is only modified from one place. Also keep in mind that
  36. |project_name| will keep an exclusive lock on the repository while creating
  37. or deleting archives, which may make *simultaneous* backups fail.
  38. Can I copy or synchronize my repo to another location?
  39. ------------------------------------------------------
  40. If you want to have redundant backup repositories (preferably at separate
  41. locations), the recommended way to do that is like this:
  42. - ``borg init repo1``
  43. - ``borg init repo2``
  44. - client machine ---borg create---> repo1
  45. - client machine ---borg create---> repo2
  46. This will create distinct repositories (separate repo ID, separate
  47. keys) and nothing bad happening in repo1 will influence repo2.
  48. Some people decide against above recommendation and create identical
  49. copies of a repo (using some copy / sync / clone tool).
  50. While this might be better than having no redundancy at all, you have
  51. to be very careful about how you do that and what you may / must not
  52. do with the result (if you decide against our recommendation).
  53. What you would get with this is:
  54. - client machine ---borg create---> repo
  55. - repo ---copy/sync---> copy-of-repo
  56. There is no special borg command to do the copying, you could just
  57. use any reliable tool that creates an identical copy (cp, rsync, rclone
  58. might be options).
  59. But think about whether that is really what you want. If something goes
  60. wrong in repo, you will have the same issue in copy-of-repo.
  61. Make sure you do the copy/sync while no backup is running, see
  62. :ref:`borg_with-lock` about how to do that.
  63. Also, you must not run borg against multiple instances of the same repo
  64. (like repo and copy-of-repo) as that would create severe issues:
  65. - Data loss: they have the same repository ID, so the borg client will
  66. think they are identical and e.g. use the same local cache for them
  67. (which is an issue if they happen to be not the same).
  68. See :issue:`4272` for an example.
  69. - Encryption security issues if you would update repo and copy-of-repo
  70. independently, due to AES counter reuse.
  71. There is also a similar encryption security issue for the disaster case:
  72. If you lose repo and the borg client-side config/cache and you restore
  73. the repo from an older copy-of-repo, you also run into AES counter reuse.
  74. Which file types, attributes, etc. are *not* preserved?
  75. -------------------------------------------------------
  76. * UNIX domain sockets (because it does not make sense - they are
  77. meaningless without the running process that created them and the process
  78. needs to recreate them in any case). So, don't panic if your backup
  79. misses a UDS!
  80. * The precise on-disk (or rather: not-on-disk) representation of the holes
  81. in a sparse file.
  82. Archive creation has no special support for sparse files, holes are
  83. backed up as (deduplicated and compressed) runs of zero bytes.
  84. Archive extraction has optional support to extract all-zero chunks as
  85. holes in a sparse file.
  86. * Some filesystem specific attributes, like btrfs NOCOW, see :ref:`platforms`.
  87. * For hardlinked symlinks, the hardlinking can not be archived (and thus,
  88. the hardlinking will not be done at extraction time). The symlinks will
  89. be archived and extracted as non-hardlinked symlinks, see :issue:`2379`.
  90. Are there other known limitations?
  91. ----------------------------------
  92. - A single archive can only reference a limited volume of file/dir metadata,
  93. usually corresponding to tens or hundreds of millions of files/dirs.
  94. When trying to go beyond that limit, you will get a fatal IntegrityError
  95. exception telling that the (archive) object is too big.
  96. An easy workaround is to create multiple archives with fewer items each.
  97. See also the :ref:`archive_limitation` and :issue:`1452`.
  98. :ref:`borg_info` shows how large (relative to the maximum size) existing
  99. archives are.
  100. - borg extract only supports restoring into an empty destination. After that,
  101. the destination will exactly have the contents of the extracted archive.
  102. If you extract into a non-empty destination, borg will (for example) not
  103. remove files which are in the destination, but not in the archive.
  104. See :issue:`4598` for a workaround and more details.
  105. .. _checkpoints_parts:
  106. If a backup stops mid-way, does the already-backed-up data stay there?
  107. ----------------------------------------------------------------------
  108. Yes, |project_name| supports resuming backups.
  109. During a backup a special checkpoint archive named ``<archive-name>.checkpoint``
  110. is saved every checkpoint interval (the default value for this is 30
  111. minutes) containing all the data backed-up until that point.
  112. This checkpoint archive is a valid archive,
  113. but it is only a partial backup (not all files that you wanted to backup are
  114. contained in it). Having it in the repo until a successful, full backup is
  115. completed is useful because it references all the transmitted chunks up
  116. to the checkpoint. This means that in case of an interruption, you only need to
  117. retransfer the data since the last checkpoint.
  118. If a backup was interrupted, you normally do not need to do anything special,
  119. just invoke ``borg create`` as you always do. If the repository is still locked,
  120. you may need to run ``borg break-lock`` before the next backup. You may use the
  121. same archive name as in previous attempt or a different one (e.g. if you always
  122. include the current datetime), it does not matter.
  123. |project_name| always does full single-pass backups, so it will start again
  124. from the beginning - but it will be much faster, because some of the data was
  125. already stored into the repo (and is still referenced by the checkpoint
  126. archive), so it does not need to get transmitted and stored again.
  127. Once your backup has finished successfully, you can delete all
  128. ``<archive-name>.checkpoint`` archives. If you run ``borg prune``, it will
  129. also care for deleting unneeded checkpoints.
  130. Note: the checkpointing mechanism creates hidden, partial files in an archive,
  131. so that checkpoints even work while a big file is being processed.
  132. They are named ``<filename>.borg_part_<N>`` and all operations usually ignore
  133. these files, but you can make them considered by giving the option
  134. ``--consider-part-files``. You usually only need that option if you are
  135. really desperate (e.g. if you have no completed backup of that file and you'ld
  136. rather get a partial file extracted than nothing). You do **not** want to give
  137. that option under any normal circumstances.
  138. Note that checkpoints inside files are created only since version 1.1, make
  139. sure you have an up-to-date version of borgbackup if you want to continue
  140. instead of retransferring a huge file. In some cases, there is only an outdated
  141. version shipped with your distribution (e.g. Debian). See :ref:`installation`.
  142. How can I backup huge file(s) over a unstable connection?
  143. ---------------------------------------------------------
  144. This is not a problem anymore.
  145. For more details, see :ref:`checkpoints_parts`.
  146. How can I switch append-only mode on and off?
  147. -----------------------------------------------------------------------------------------------------------------------------------
  148. You could do that (via borg config REPO append_only 0/1), but using different
  149. ssh keys and different entries in ``authorized_keys`` is much easier and also
  150. maybe has less potential of things going wrong somehow.
  151. My machine goes to sleep causing `Broken pipe`
  152. ----------------------------------------------
  153. When backing up your data over the network, your machine should not go to sleep.
  154. On macOS you can use `caffeinate` to avoid that.
  155. How can I restore huge file(s) over an unstable connection?
  156. -----------------------------------------------------------
  157. If you cannot manage to extract the whole big file in one go, you can extract
  158. all the part files and manually concatenate them together.
  159. For more details, see :ref:`checkpoints_parts`.
  160. Can |project_name| add redundancy to the backup data to deal with hardware malfunction?
  161. ---------------------------------------------------------------------------------------
  162. No, it can't. While that at first sounds like a good idea to defend against
  163. some defect HDD sectors or SSD flash blocks, dealing with this in a
  164. reliable way needs a lot of low-level storage layout information and
  165. control which we do not have (and also can't get, even if we wanted).
  166. So, if you need that, consider RAID or a filesystem that offers redundant
  167. storage or just make backups to different locations / different hardware.
  168. See also :issue:`225`.
  169. Can |project_name| verify data integrity of a backup archive?
  170. -------------------------------------------------------------
  171. Yes, if you want to detect accidental data damage (like bit rot), use the
  172. ``check`` operation. It will notice corruption using CRCs and hashes.
  173. If you want to be able to detect malicious tampering also, use an encrypted
  174. repo. It will then be able to check using CRCs and HMACs.
  175. Can I use Borg on SMR hard drives?
  176. ----------------------------------
  177. SMR (shingled magnetic recording) hard drives are very different from
  178. regular hard drives. Applications have to behave in certain ways or
  179. performance will be heavily degraded.
  180. Borg 1.1 ships with default settings suitable for SMR drives,
  181. and has been successfully tested on *Seagate Archive v2* drives
  182. using the ext4 file system.
  183. Some Linux kernel versions between 3.19 and 4.5 had various bugs
  184. handling device-managed SMR drives, leading to IO errors, unresponsive
  185. drives and unreliable operation in general.
  186. For more details, refer to :issue:`2252`.
  187. .. _faq-integrityerror:
  188. I get an IntegrityError or similar - what now?
  189. ----------------------------------------------
  190. A single error does not necessarily indicate bad hardware or a Borg
  191. bug. All hardware exhibits a bit error rate (BER). Hard drives are typically
  192. specified as exhibiting fewer than one error every 12 to 120 TB
  193. (one bit error in 10e14 to 10e15 bits). The specification is often called
  194. *unrecoverable read error rate* (URE rate).
  195. Apart from these very rare errors there are two main causes of errors:
  196. (i) Defective hardware: described below.
  197. (ii) Bugs in software (Borg, operating system, libraries):
  198. Ensure software is up to date.
  199. Check whether the issue is caused by any fixed bugs described in :ref:`important_notes`.
  200. .. rubric:: Finding defective hardware
  201. .. note::
  202. Hardware diagnostics are operating system dependent and do not
  203. apply universally. The commands shown apply for popular Unix-like
  204. systems. Refer to your operating system's manual.
  205. Checking hard drives
  206. Find the drive containing the repository and use *findmnt*, *mount* or *lsblk*
  207. to learn the device path (typically */dev/...*) of the drive.
  208. Then, smartmontools can retrieve self-diagnostics of the drive in question::
  209. # smartctl -a /dev/sdSomething
  210. The *Offline_Uncorrectable*, *Current_Pending_Sector* and *Reported_Uncorrect*
  211. attributes indicate data corruption. A high *UDMA_CRC_Error_Count* usually
  212. indicates a bad cable.
  213. I/O errors logged by the system (refer to the system journal or
  214. dmesg) can point to issues as well. I/O errors only affecting the
  215. file system easily go unnoticed, since they are not reported to
  216. applications (e.g. Borg), while these errors can still corrupt data.
  217. Drives can corrupt some sectors in one event, while remaining
  218. reliable otherwise. Conversely, drives can fail completely with no
  219. advance warning. If in doubt, copy all data from the drive in
  220. question to another drive -- just in case it fails completely.
  221. If any of these are suspicious, a self-test is recommended::
  222. # smartctl -t long /dev/sdSomething
  223. Running ``fsck`` if not done already might yield further insights.
  224. Checking memory
  225. Intermittent issues, such as ``borg check`` finding errors
  226. inconsistently between runs, are frequently caused by bad memory.
  227. Run memtest86+ (or an equivalent memory tester) to verify that
  228. the memory subsystem is operating correctly.
  229. Checking processors
  230. Processors rarely cause errors. If they do, they are usually overclocked
  231. or otherwise operated outside their specifications. We do not recommend to
  232. operate hardware outside its specifications for productive use.
  233. Tools to verify correct processor operation include Prime95 (mprime), linpack,
  234. and the `Intel Processor Diagnostic Tool
  235. <https://downloadcenter.intel.com/download/19792/Intel-Processor-Diagnostic-Tool>`_
  236. (applies only to Intel processors).
  237. .. rubric:: Repairing a damaged repository
  238. With any defective hardware found and replaced, the damage done to the repository
  239. needs to be ascertained and fixed.
  240. :ref:`borg_check` provides diagnostics and ``--repair`` options for repositories with
  241. issues. We recommend to first run without ``--repair`` to assess the situation.
  242. If the found issues and proposed repairs seem right, re-run "check" with ``--repair`` enabled.
  243. Why is the time elapsed in the archive stats different from wall clock time?
  244. ----------------------------------------------------------------------------
  245. Borg needs to write the time elapsed into the archive metadata before finalizing
  246. the archive, compacting the segments, and committing the repo & cache. This means
  247. when Borg is run with e.g. the ``time`` command, the duration shown in the archive
  248. stats may be shorter than the full time the command runs for.
  249. How do I configure different prune policies for different directories?
  250. ----------------------------------------------------------------------
  251. Say you want to prune ``/var/log`` faster than the rest of
  252. ``/``. How do we implement that? The answer is to backup to different
  253. archive *names* and then implement different prune policies for
  254. different prefixes. For example, you could have a script that does::
  255. borg create --exclude /var/log $REPOSITORY:main-$(date +%Y-%m-%d) /
  256. borg create $REPOSITORY:logs-$(date +%Y-%m-%d) /var/log
  257. Then you would have two different prune calls with different policies::
  258. borg prune --verbose --list -d 30 --prefix main- "$REPOSITORY"
  259. borg prune --verbose --list -d 7 --prefix logs- "$REPOSITORY"
  260. This will keep 7 days of logs and 30 days of everything else. Borg 1.1
  261. also supports the ``--glob-archives`` parameter.
  262. How do I remove files from an existing backup?
  263. ----------------------------------------------
  264. Say you now want to remove old logfiles because you changed your
  265. backup policy as described above. The only way to do this is to use
  266. the :ref:`borg_recreate` command to rewrite all archives with a
  267. different ``--exclude`` pattern. See the examples in the
  268. :ref:`borg_recreate` manpage for more information.
  269. Can I safely change the compression level or algorithm?
  270. --------------------------------------------------------
  271. The compression level and algorithm don't affect deduplication. Chunk ID hashes
  272. are calculated *before* compression. New compression settings
  273. will only be applied to new chunks, not existing chunks. So it's safe
  274. to change them.
  275. Security
  276. ########
  277. .. _borg_security_critique:
  278. Isn't BorgBackup's AES-CTR crypto broken?
  279. -----------------------------------------
  280. If a nonce (counter) value is reused, AES-CTR mode crypto is broken.
  281. To exploit the AES counter management issue, an attacker would need to have
  282. access to the borg repository.
  283. By tampering with the repo, the attacker could bring the repo into a state so
  284. that it reports a lower "highest used counter value" than the one that actually
  285. was used. The client would usually notice that, because it rather trusts the
  286. clientside stored "highest used counter value" than trusting the server.
  287. But there are situations, where this is simply not possible:
  288. - If clients A and B used the repo, the client A can only know its own highest
  289. CTR value, but not the one produced by B. That is only known to (B and) the
  290. server (the repo) and thus the client A needs to trust the server about the
  291. value produced by B in that situation. You can't do much about this except
  292. not having multiple clients per repo.
  293. - Even if there is only one client, if client-side information is completely
  294. lost (e.g. due to disk defect), the client also needs to trust the value from
  295. server side. You can avoid this by not continuing to write to the repository
  296. after you have lost clientside borg information.
  297. .. _home_config_borg:
  298. How important is the $HOME/.config/borg directory?
  299. --------------------------------------------------
  300. The Borg config directory has content that you should take care of:
  301. ``security`` subdirectory
  302. Each directory here represents one Borg repository by its ID and contains the last known status.
  303. If a repository's status is different from this information at the beginning of BorgBackup
  304. operation, Borg outputs warning messages and asks for confirmation, so make sure you do not lose
  305. or manipulate these files. However, apart from those warnings, a loss of these files can be
  306. recovered.
  307. ``keys`` subdirectory
  308. In this directory all your repository keyfiles are stored. You MUST make sure to have an
  309. independent backup of these keyfiles, otherwise you cannot access your backups anymore if you lose
  310. them. You also MUST keep these files secret; everyone who gains access to your repository and has
  311. the corresponding keyfile (and the key passphrase) can extract it.
  312. Make sure that only you have access to the Borg config directory.
  313. .. _cache_security:
  314. Do I need to take security precautions regarding the cache?
  315. -----------------------------------------------------------
  316. The cache contains a lot of metadata information about the files in
  317. your repositories and it is not encrypted.
  318. However, the assumption is that the cache is being stored on the very
  319. same system which also contains the original files which are being
  320. backed up. So someone with access to the cache files would also have
  321. access the the original files anyway.
  322. The Internals section contains more details about :ref:`cache`. If you ever need to move the cache
  323. to a different location, this can be achieved by using the appropriate :ref:`env_vars`.
  324. How can I specify the encryption passphrase programmatically?
  325. -------------------------------------------------------------
  326. There are several ways to specify a passphrase without human intervention:
  327. Setting ``BORG_PASSPHRASE``
  328. The passphrase can be specified using the ``BORG_PASSPHRASE`` enviroment variable.
  329. This is often the simplest option, but can be insecure if the script that sets it
  330. is world-readable.
  331. .. _password_env:
  332. .. note:: Be careful how you set the environment; using the ``env``
  333. command, a ``system()`` call or using inline shell scripts
  334. (e.g. ``BORG_PASSPHRASE=hunter2 borg ...``)
  335. might expose the credentials in the process list directly
  336. and they will be readable to all users on a system. Using
  337. ``export`` in a shell script file should be safe, however, as
  338. the environment of a process is `accessible only to that
  339. user
  340. <https://security.stackexchange.com/questions/14000/environment-variable-accessibility-in-linux/14009#14009>`_.
  341. Using ``BORG_PASSCOMMAND`` with a properly permissioned file
  342. Another option is to create a file with a password in it in your home
  343. directory and use permissions to keep anyone else from reading it. For
  344. example, first create a key::
  345. head -c 32 /dev/urandom | base64 -w 0 > ~/.borg-passphrase
  346. chmod 400 ~/.borg-passphrase
  347. Then in an automated script one can put::
  348. export BORG_PASSCOMMAND="cat $HOME/.borg-passphrase"
  349. and Borg will automatically use that passphrase.
  350. Using keyfile-based encryption with a blank passphrase
  351. It is possible to encrypt your repository in ``keyfile`` mode instead of the default
  352. ``repokey`` mode and use a blank passphrase for the key file (simply press Enter twice
  353. when ``borg init`` asks for the password). See :ref:`encrypted_repos`
  354. for more details.
  355. Using ``BORG_PASSCOMMAND`` with macOS Keychain
  356. macOS has a native manager for secrets (such as passphrases) which is safer
  357. than just using a file as it is encrypted at rest and unlocked manually
  358. (fortunately, the login keyring automatically unlocks when you login). With
  359. the built-in ``security`` command, you can access it from the command line,
  360. making it useful for ``BORG_PASSCOMMAND``.
  361. First generate a passphrase and use ``security`` to save it to your login
  362. (default) keychain::
  363. security add-generic-password -D secret -U -a $USER -s borg-passphrase -w $(head -c 32 /dev/urandom | base64 -w 0)
  364. In your backup script retrieve it in the ``BORG_PASSCOMMAND``::
  365. export BORG_PASSCOMMAND="security find-generic-password -a $USER -s borg-passphrase -w"
  366. Using ``BORG_PASSCOMMAND`` with GNOME Keyring
  367. GNOME also has a keyring daemon that can be used to store a Borg passphrase.
  368. First ensure ``libsecret-tools``, ``gnome-keyring`` and ``libpam-gnome-keyring``
  369. are installed. If ``libpam-gnome-keyring`` wasn't already installed, ensure it
  370. runs on login::
  371. sudo sh -c "echo session optional pam_gnome_keyring.so auto_start >> /etc/pam.d/login"
  372. sudo sh -c "echo password optional pam_gnome_keyring.so >> /etc/pam.d/passwd"
  373. # you may need to relogin afterwards to activate the login keyring
  374. Then add a secret to the login keyring::
  375. head -c 32 /dev/urandom | base64 -w 0 | secret-tool store borg-repository repo-name --label="Borg Passphrase"
  376. If a dialog box pops up prompting you to pick a password for a new keychain, use your
  377. login password. If there is a checkbox for automatically unlocking on login, check it
  378. to allow backups without any user intervention whatsoever.
  379. Once the secret is saved, retrieve it in a backup script using ``BORG_PASSCOMMAND``::
  380. export BORG_PASSCOMMAND="secret-tool lookup borg-repository repo-name"
  381. .. note:: For this to automatically unlock the keychain it must be run
  382. in the ``dbus`` session of an unlocked terminal; for example, running a backup
  383. script as a ``cron`` job might not work unless you also ``export DISPLAY=:0``
  384. so ``secret-tool`` can pick up your open session. `It gets even more complicated`__
  385. when you are running the tool as a different user (e.g. running a backup as root
  386. with the password stored in the user keyring).
  387. __ https://github.com/borgbackup/borg/pull/2837#discussion_r127641330
  388. Using ``BORG_PASSCOMMAND`` with KWallet
  389. KDE also has a keychain feature in the form of KWallet. The command-line tool
  390. ``kwalletcli`` can be used to store and retrieve secrets. Ensure ``kwalletcli``
  391. is installed, generate a passphrase, and store it in your "wallet"::
  392. head -c 32 /dev/urandom | base64 -w 0 | kwalletcli -Pe borg-passphrase -f Passwords
  393. Once the secret is saved, retrieve it in a backup script using ``BORG_PASSCOMMAND``::
  394. export BORG_PASSCOMMAND="kwalletcli -e borg-passphrase -f Passwords"
  395. When backing up to remote encrypted repos, is encryption done locally?
  396. ----------------------------------------------------------------------
  397. Yes, file and directory metadata and data is locally encrypted, before
  398. leaving the local machine. We do not mean the transport layer encryption
  399. by that, but the data/metadata itself. Transport layer encryption (e.g.
  400. when ssh is used as a transport) applies additionally.
  401. When backing up to remote servers, do I have to trust the remote server?
  402. ------------------------------------------------------------------------
  403. Yes and No.
  404. No, as far as data confidentiality is concerned - if you use encryption,
  405. all your files/dirs data and metadata are stored in their encrypted form
  406. into the repository.
  407. Yes, as an attacker with access to the remote server could delete (or
  408. otherwise make unavailable) all your backups.
  409. How can I protect against a hacked backup client?
  410. -------------------------------------------------
  411. Assume you backup your backup client machine C to the backup server S and
  412. C gets hacked. In a simple push setup, the attacker could then use borg on
  413. C to delete all backups residing on S.
  414. These are your options to protect against that:
  415. - Do not allow to permanently delete data from the repo, see :ref:`append_only_mode`.
  416. - Use a pull-mode setup using ``ssh -R``, see :issue:`900`.
  417. - Mount C's filesystem on another machine and then create a backup of it.
  418. - Do not give C filesystem-level access to S.
  419. See :ref:`hosting_repositories` for a detailed protection guide.
  420. How can I protect against a hacked backup server?
  421. -------------------------------------------------
  422. Just in case you got the impression that pull-mode backups are way more safe
  423. than push-mode, you also need to consider the case that your backup server S
  424. gets hacked. In case S has access to a lot of clients C, that might bring you
  425. into even bigger trouble than a hacked backup client in the previous FAQ entry.
  426. These are your options to protect against that:
  427. - Use the standard push-mode setup (see also previous FAQ entry).
  428. - Mount (the repo part of) S's filesystem on C.
  429. - Do not give S file-system level access to C.
  430. - Have your backup server at a well protected place (maybe not reachable from
  431. the internet), configure it safely, apply security updates, monitor it, ...
  432. How can I protect against theft, sabotage, lightning, fire, ...?
  433. ----------------------------------------------------------------
  434. In general: if your only backup medium is nearby the backupped machine and
  435. always connected, you can easily get into trouble: they likely share the same
  436. fate if something goes really wrong.
  437. Thus:
  438. - have multiple backup media
  439. - have media disconnected from network, power, computer
  440. - have media at another place
  441. - have a relatively recent backup on your media
  442. How do I report a security issue with Borg?
  443. -------------------------------------------
  444. Send a private email to the :ref:`security contact <security-contact>`
  445. if you think you have discovered a security issue.
  446. Please disclose security issues responsibly.
  447. Common issues
  448. #############
  449. Why does Borg extract hang after some time?
  450. -------------------------------------------
  451. When I do a ``borg extract``, after a while all activity stops, no cpu usage,
  452. no downloads.
  453. This may happen when the SSH connection is stuck on server side. You can
  454. configure SSH on client side to prevent this by sending keep-alive requests,
  455. for example in ~/.ssh/config:
  456. ::
  457. Host borg.example.com
  458. # Client kills connection after 3*30 seconds without server response:
  459. ServerAliveInterval 30
  460. ServerAliveCountMax 3
  461. You can also do the opposite and configure SSH on server side in
  462. /etc/ssh/sshd_config, to make the server send keep-alive requests to the client:
  463. ::
  464. # Server kills connection after 3*30 seconds without client response:
  465. ClientAliveInterval 30
  466. ClientAliveCountMax 3
  467. How can I deal with my very unstable SSH connection?
  468. ----------------------------------------------------
  469. If you have issues with lost connections during long-running borg commands, you
  470. could try to work around:
  471. - Make partial extracts like ``borg extract REPO PATTERN`` to do multiple
  472. smaller extraction runs that complete before your connection has issues.
  473. - Try using ``borg mount REPO MOUNTPOINT`` and ``rsync -avH`` from
  474. ``MOUNTPOINT`` to your desired extraction directory. If the connection breaks
  475. down, just repeat that over and over again until rsync does not find anything
  476. to do any more. Due to the way borg mount works, this might be less efficient
  477. than borg extract for bigger volumes of data.
  478. Why do I get "connection closed by remote" after a while?
  479. ---------------------------------------------------------
  480. When doing a backup to a remote server (using a ssh: repo URL), it sometimes
  481. stops after a while (some minutes, hours, ... - not immediately) with
  482. "connection closed by remote" error message. Why?
  483. That's a good question and we are trying to find a good answer in :issue:`636`.
  484. Why am I seeing idle borg serve processes on the repo server?
  485. -------------------------------------------------------------
  486. Maybe the ssh connection between client and server broke down and that was not
  487. yet noticed on the server. Try these settings:
  488. ::
  489. # /etc/ssh/sshd_config on borg repo server - kill connection to client
  490. # after ClientAliveCountMax * ClientAliveInterval seconds with no response
  491. ClientAliveInterval 20
  492. ClientAliveCountMax 3
  493. If you have multiple borg create ... ; borg create ... commands in a already
  494. serialized way in a single script, you need to give them ``--lock-wait N`` (with N
  495. being a bit more than the time the server needs to terminate broken down
  496. connections and release the lock).
  497. .. _disable_archive_chunks:
  498. The borg cache eats way too much disk space, what can I do?
  499. -----------------------------------------------------------
  500. This may especially happen if borg needs to rebuild the local "chunks" index -
  501. either because it was removed, or because it was not coherent with the
  502. repository state any more (e.g. because another borg instance changed the
  503. repository).
  504. To optimize this rebuild process, borg caches per-archive information in the
  505. ``chunks.archive.d/`` directory. It won't help the first time it happens, but it
  506. will make the subsequent rebuilds faster (because it needs to transfer less data
  507. from the repository). While being faster, the cache needs quite some disk space,
  508. which might be unwanted.
  509. There is a temporary (but maybe long lived) hack to avoid using lots of disk
  510. space for chunks.archive.d (see :issue:`235` for details):
  511. ::
  512. # this assumes you are working with the same user as the backup.
  513. cd ~/.cache/borg/$(borg config /path/to/repo id)
  514. rm -rf chunks.archive.d ; touch chunks.archive.d
  515. This deletes all the cached archive chunk indexes and replaces the directory
  516. that kept them with a file, so borg won't be able to store anything "in" there
  517. in future.
  518. This has some pros and cons, though:
  519. - much less disk space needs for ~/.cache/borg.
  520. - chunk cache resyncs will be slower as it will have to transfer chunk usage
  521. metadata for all archives from the repository (which might be slow if your
  522. repo connection is slow) and it will also have to build the hashtables from
  523. that data.
  524. chunk cache resyncs happen e.g. if your repo was written to by another
  525. machine (if you share same backup repo between multiple machines) or if
  526. your local chunks cache was lost somehow.
  527. The long term plan to improve this is called "borgception", see :issue:`474`.
  528. Can I backup my root partition (/) with Borg?
  529. ---------------------------------------------
  530. Backing up your entire root partition works just fine, but remember to
  531. exclude directories that make no sense to backup, such as /dev, /proc,
  532. /sys, /tmp and /run, and to use ``--one-file-system`` if you only want to
  533. backup the root partition (and not any mounted devices e.g.).
  534. If it crashes with a UnicodeError, what can I do?
  535. -------------------------------------------------
  536. Check if your encoding is set correctly. For most POSIX-like systems, try::
  537. export LANG=en_US.UTF-8 # or similar, important is correct charset
  538. I can't extract non-ascii filenames by giving them on the commandline!?
  539. -----------------------------------------------------------------------
  540. This might be due to different ways to represent some characters in unicode
  541. or due to other non-ascii encoding issues.
  542. If you run into that, try this:
  543. - avoid the non-ascii characters on the commandline by e.g. extracting
  544. the parent directory (or even everything)
  545. - mount the repo using FUSE and use some file manager
  546. .. _expected_performance:
  547. What's the expected backup performance?
  548. ---------------------------------------
  549. A first backup will usually be somehow "slow" because there is a lot of data
  550. to process. Performance here depends on a lot of factors, so it is hard to
  551. give specific numbers.
  552. Subsequent backups are usually very fast if most files are unchanged and only
  553. a few are new or modified. The high performance on unchanged files primarily depends
  554. only on a few factors (like fs recursion + metadata reading performance and the
  555. files cache working as expected) and much less on other factors.
  556. E.g., for this setup:
  557. - server grade machine (4C/8T 2013 Xeon, 64GB RAM, 2x good 7200RPM disks)
  558. - local zfs filesystem (mirrored) containing the backup source data
  559. - repository is remote (does not matter much for unchanged files)
  560. - backup job runs while machine is otherwise idle
  561. The observed performance is that |project_name| can process about
  562. **1 million unchanged files (and a few small changed ones) in 4 minutes!**
  563. If you are seeing much less than that in similar circumstances, read the next
  564. few FAQ entries below.
  565. .. _slow_backup:
  566. Why is backup slow for me?
  567. --------------------------
  568. So, if you feel your |project_name| backup is too slow somehow, you should find out why.
  569. The usual way to approach this is to add ``--list --filter=AME --stats`` to your
  570. ``borg create`` call to produce more log output, including a file list (with file status
  571. characters) and also some statistics at the end of the backup.
  572. Then you do the backup and look at the log output:
  573. - stats: Do you really have little changes or are there more changes than you thought?
  574. In the stats you can see the overall volume of changed data, which needed to be
  575. added to the repo. If that is a lot, that can be the reason why it is slow.
  576. - ``A`` status ("added") in the file list:
  577. If you see that often, you have a lot of new files (files that |project_name| did not find
  578. in the files cache). If you think there is something wrong with that (the file was there
  579. already in the previous backup), please read the FAQ entries below.
  580. - ``M`` status ("modified") in the file list:
  581. If you see that often, |project_name| thinks that a lot of your files might be modified
  582. (|project_name| found them in the files cache, but the metadata read from the filesystem did
  583. not match the metadata stored in the files cache).
  584. In such a case, |project_name| will need to process the files' contents completely, which is
  585. much slower than processing unmodified files (|project_name| does not read their contents!).
  586. The metadata values used in this comparison are determined by the ``--files-cache`` option
  587. and could be e.g. size, ctime and inode number (see the ``borg create`` docs for more
  588. details and potential issues).
  589. You can use the ``stat`` command on files to manually look at fs metadata to debug if
  590. there is any unexpected change triggering the ``M`` status.
  591. See also the next few FAQ entries for more details.
  592. .. _a_status_oddity:
  593. I am seeing 'A' (added) status for an unchanged file!?
  594. ------------------------------------------------------
  595. The files cache is used to determine whether |project_name| already
  596. "knows" / has backed up a file and if so, to skip the file from
  597. chunking. It does intentionally *not* contain files that have a timestamp
  598. same as the newest timestamp in the created archive.
  599. So, if you see an 'A' status for unchanged file(s), they are likely the files
  600. with the most recent timestamp in that archive.
  601. This is expected: it is to avoid data loss with files that are backed up from
  602. a snapshot and that are immediately changed after the snapshot (but within
  603. timestamp granularity time, so the timestamp would not change). Without the code that
  604. removes these files from the files cache, the change that happened right after
  605. the snapshot would not be contained in the next backup as |project_name| would
  606. think the file is unchanged.
  607. This does not affect deduplication, the file will be chunked, but as the chunks
  608. will often be the same and already stored in the repo (except in the above
  609. mentioned rare condition), it will just re-use them as usual and not store new
  610. data chunks.
  611. If you want to avoid unnecessary chunking, just create or touch a small or
  612. empty file in your backup source file set (so that one has the latest timestamp,
  613. not your 50GB VM disk image) and, if you do snapshots, do the snapshot after
  614. that.
  615. Since only the files cache is used in the display of files status,
  616. those files are reported as being added when, really, chunks are
  617. already used.
  618. By default, ctime (change time) is used for the timestamps to have a rather
  619. safe change detection (see also the --files-cache option).
  620. Furthermore, pathnames recorded in files cache are always absolute, even if you specify
  621. source directories with relative pathname. If relative pathnames are stable, but absolute are
  622. not (for example if you mount a filesystem without stable mount points for each backup or
  623. if you are running the backup from a filesystem snapshot whose name is not stable), borg
  624. will assume that files are different and will report them as 'added', even though no new
  625. chunks will be actually recorded for them. To avoid this, you could bind mount your source
  626. directory in a directory with the stable path.
  627. .. _always_chunking:
  628. It always chunks all my files, even unchanged ones!
  629. ---------------------------------------------------
  630. |project_name| maintains a files cache where it remembers the timestamp, size
  631. and inode of files. When |project_name| does a new backup and starts processing
  632. a file, it first looks whether the file has changed (compared to the values
  633. stored in the files cache). If the values are the same, the file is assumed
  634. unchanged and thus its contents won't get chunked (again).
  635. |project_name| can't keep an infinite history of files of course, thus entries
  636. in the files cache have a "maximum time to live" which is set via the
  637. environment variable BORG_FILES_CACHE_TTL (and defaults to 20).
  638. Every time you do a backup (on the same machine, using the same user), the
  639. cache entries' ttl values of files that were not "seen" are incremented by 1
  640. and if they reach BORG_FILES_CACHE_TTL, the entry is removed from the cache.
  641. So, for example, if you do daily backups of 26 different data sets A, B,
  642. C, ..., Z on one machine (using the default TTL), the files from A will be
  643. already forgotten when you repeat the same backups on the next day and it
  644. will be slow because it would chunk all the files each time. If you set
  645. BORG_FILES_CACHE_TTL to at least 26 (or maybe even a small multiple of that),
  646. it would be much faster.
  647. Another possible reason is that files don't always have the same path, for
  648. example if you mount a filesystem without stable mount points for each backup or if you are running the backup from a filesystem snapshot whose name is not stable.
  649. If the directory where you mount a filesystem is different every time,
  650. |project_name| assumes they are different files. This is true even if you backup these files with relative pathnames - borg uses full
  651. pathnames in files cache regardless.
  652. Is there a way to limit bandwidth with |project_name|?
  653. ------------------------------------------------------
  654. To limit upload (i.e. :ref:`borg_create`) bandwidth, use the
  655. ``--remote-ratelimit`` option.
  656. There is no built-in way to limit *download*
  657. (i.e. :ref:`borg_extract`) bandwidth, but limiting download bandwidth
  658. can be accomplished with pipeviewer_:
  659. Create a wrapper script: /usr/local/bin/pv-wrapper
  660. ::
  661. #!/bin/sh
  662. ## -q, --quiet do not output any transfer information at all
  663. ## -L, --rate-limit RATE limit transfer to RATE bytes per second
  664. RATE=307200
  665. pv -q -L $RATE | "$@"
  666. Add BORG_RSH environment variable to use pipeviewer wrapper script with ssh.
  667. ::
  668. export BORG_RSH='/usr/local/bin/pv-wrapper ssh'
  669. Now |project_name| will be bandwidth limited. Nice thing about pv is that you can change rate-limit on the fly:
  670. ::
  671. pv -R $(pidof pv) -L 102400
  672. .. _pipeviewer: http://www.ivarch.com/programs/pv.shtml
  673. How can I avoid unwanted base directories getting stored into archives?
  674. -----------------------------------------------------------------------
  675. Possible use cases:
  676. - Another file system is mounted and you want to backup it with original paths.
  677. - You have created a BTRFS snapshot in a ``/.snapshots`` directory for backup.
  678. To achieve this, run ``borg create`` within the mountpoint/snapshot directory:
  679. ::
  680. # Example: Some file system mounted in /mnt/rootfs.
  681. cd /mnt/rootfs
  682. borg create /path/to/repo::rootfs_backup .
  683. I am having troubles with some network/FUSE/special filesystem, why?
  684. --------------------------------------------------------------------
  685. |project_name| is doing nothing special in the filesystem, it only uses very
  686. common and compatible operations (even the locking is just "mkdir").
  687. So, if you are encountering issues like slowness, corruption or malfunction
  688. when using a specific filesystem, please try if you can reproduce the issues
  689. with a local (non-network) and proven filesystem (like ext4 on Linux).
  690. If you can't reproduce the issue then, you maybe have found an issue within
  691. the filesystem code you used (not with |project_name|). For this case, it is
  692. recommended that you talk to the developers / support of the network fs and
  693. maybe open an issue in their issue tracker. Do not file an issue in the
  694. |project_name| issue tracker.
  695. If you can reproduce the issue with the proven filesystem, please file an
  696. issue in the |project_name| issue tracker about that.
  697. Why does running 'borg check --repair' warn about data loss?
  698. ------------------------------------------------------------
  699. Repair usually works for recovering data in a corrupted archive. However,
  700. it's impossible to predict all modes of corruption. In some very rare
  701. instances, such as malfunctioning storage hardware, additional repo
  702. corruption may occur. If you can't afford to lose the repo, it's strongly
  703. recommended that you perform repair on a copy of the repo.
  704. In other words, the warning is there to emphasize that |project_name|:
  705. - Will perform automated routines that modify your backup repository
  706. - Might not actually fix the problem you are experiencing
  707. - Might, in very rare cases, further corrupt your repository
  708. In the case of malfunctioning hardware, such as a drive or USB hub
  709. corrupting data when read or written, it's best to diagnose and fix the
  710. cause of the initial corruption before attempting to repair the repo. If
  711. the corruption is caused by a one time event such as a power outage,
  712. running `borg check --repair` will fix most problems.
  713. Why isn't there more progress / ETA information displayed?
  714. ----------------------------------------------------------
  715. Some borg runs take quite a bit, so it would be nice to see a progress display,
  716. maybe even including a ETA (expected time of "arrival" [here rather "completion"]).
  717. For some functionality, this can be done: if the total amount of work is more or
  718. less known, we can display progress. So check if there is a ``--progress`` option.
  719. But sometimes, the total amount is unknown (e.g. for ``borg create`` we just do
  720. a single pass over the filesystem, so we do not know the total file count or data
  721. volume before reaching the end). Adding another pass just to determine that would
  722. take additional time and could be incorrect, if the filesystem is changing.
  723. Even if the fs does not change and we knew count and size of all files, we still
  724. could not compute the ``borg create`` ETA as we do not know the amount of changed
  725. chunks, how the bandwidth of source and destination or system performance might
  726. fluctuate.
  727. You see, trying to display ETA would be futile. The borg developers prefer to
  728. rather not implement progress / ETA display than doing futile attempts.
  729. See also: https://xkcd.com/612/
  730. Why am I getting 'Operation not permitted' errors when backing up on sshfs?
  731. ---------------------------------------------------------------------------
  732. By default, ``sshfs`` is not entirely POSIX-compliant when renaming files due to
  733. a technicality in the SFTP protocol. Fortunately, it also provides a workaround_
  734. to make it behave correctly::
  735. sshfs -o workaround=rename user@host:dir /mnt/dir
  736. .. _workaround: https://unix.stackexchange.com/a/123236
  737. Can I disable checking for free disk space?
  738. -------------------------------------------
  739. In some cases, the free disk space of the target volume is reported incorrectly.
  740. This can happen for CIFS- or FUSE shares. If you are sure that your target volume
  741. will always have enough disk space, you can use the following workaround to disable
  742. checking for free disk space::
  743. borg config -- $REPO_LOCATION additional_free_space -2T
  744. Miscellaneous
  745. #############
  746. Requirements for the borg single-file binary, esp. (g)libc?
  747. -----------------------------------------------------------
  748. We try to build the binary on old, but still supported systems - to keep the
  749. minimum requirement for the (g)libc low. The (g)libc can't be bundled into
  750. the binary as it needs to fit your kernel and OS, but Python and all other
  751. required libraries will be bundled into the binary.
  752. If your system fulfills the minimum (g)libc requirement (see the README that
  753. is released with the binary), there should be no problem. If you are slightly
  754. below the required version, maybe just try. Due to the dynamic loading (or not
  755. loading) of some shared libraries, it might still work depending on what
  756. libraries are actually loaded and used.
  757. In the borg git repository, there is scripts/glibc_check.py that can determine
  758. (based on the symbols' versions they want to link to) whether a set of given
  759. (Linux) binaries works with a given glibc version.
  760. Why was Borg forked from Attic?
  761. -------------------------------
  762. Borg was created in May 2015 in response to the difficulty of getting new
  763. code or larger changes incorporated into Attic and establishing a bigger
  764. developer community / more open development.
  765. More details can be found in `ticket 217
  766. <https://github.com/jborg/attic/issues/217>`_ that led to the fork.
  767. Borg intends to be:
  768. * simple:
  769. * as simple as possible, but no simpler
  770. * do the right thing by default, but offer options
  771. * open:
  772. * welcome feature requests
  773. * accept pull requests of good quality and coding style
  774. * give feedback on PRs that can't be accepted "as is"
  775. * discuss openly, don't work in the dark
  776. * changing:
  777. * Borg is not compatible with Attic
  778. * do not break compatibility accidentally, without a good reason
  779. or without warning. allow compatibility breaking for other cases.
  780. * if major version number changes, it may have incompatible changes
  781. Migrating from Attic
  782. ####################
  783. What are the differences between Attic and Borg?
  784. ------------------------------------------------
  785. Borg is a fork of `Attic`_ and maintained by "`The Borg collective`_".
  786. .. _Attic: https://github.com/jborg/attic
  787. .. _The Borg collective: https://borgbackup.readthedocs.org/en/latest/authors.html
  788. Here's a (incomplete) list of some major changes:
  789. * lots of attic issues fixed (see `issue #5 <https://github.com/borgbackup/borg/issues/5>`_),
  790. including critical data corruption bugs and security issues.
  791. * more open, faster paced development (see `issue #1 <https://github.com/borgbackup/borg/issues/1>`_)
  792. * less chunk management overhead (less memory and disk usage for chunks index)
  793. * faster remote cache resync (useful when backing up multiple machines into same repo)
  794. * compression: no, lz4, zstd, zlib or lzma compression, adjustable compression levels
  795. * repokey replaces problematic passphrase mode (you can't change the passphrase nor the pbkdf2 iteration count in "passphrase" mode)
  796. * simple sparse file support, great for virtual machine disk files
  797. * can read special files (e.g. block devices) or from stdin, write to stdout
  798. * mkdir-based locking is more compatible than attic's posix locking
  799. * uses fadvise to not spoil / blow up the fs cache
  800. * better error messages / exception handling
  801. * better logging, screen output, progress indication
  802. * tested on misc. Linux systems, 32 and 64bit, FreeBSD, OpenBSD, NetBSD, macOS
  803. Please read the :ref:`changelog` (or ``docs/changes.rst`` in the source distribution) for more
  804. information.
  805. Borg is not compatible with original Attic (but there is a one-way conversion).
  806. How do I migrate from Attic to Borg?
  807. ------------------------------------
  808. Use :ref:`borg_upgrade`. This is a one-way process that cannot be reversed.
  809. There are some caveats:
  810. - The upgrade can only be performed on local repositories.
  811. It cannot be performed on remote repositories.
  812. - If the repository is in "keyfile" encryption mode, the keyfile must
  813. exist locally or it must be manually moved after performing the upgrade:
  814. 1. Get the repository ID with ``borg config /path/to/repo id``.
  815. 2. Locate the attic key file at ``~/.attic/keys/``. The correct key for the
  816. repository starts with the line ``ATTIC_KEY <repository id>``.
  817. 3. Copy the attic key file to ``~/.config/borg/keys/``
  818. 4. Change the first line from ``ATTIC_KEY ...`` to ``BORG_KEY ...``.
  819. 5. Verify that the repository is now accessible (e.g. ``borg list <repository>``).
  820. - Attic and Borg use different :ref:`"chunker params" <chunker-params>`.
  821. This means that data added by Borg won't deduplicate with the existing data
  822. stored by Attic. The effect is lessened if the files cache is used with Borg.
  823. - Repositories in "passphrase" mode *must* be migrated to "repokey" mode using
  824. :ref:`borg_key_migrate-to-repokey`. Borg does not support the "passphrase" mode
  825. any other way.
  826. Why is my backup bigger than with attic?
  827. ----------------------------------------
  828. Attic was rather unflexible when it comes to compression, it always
  829. compressed using zlib level 6 (no way to switch compression off or
  830. adjust the level or algorithm).
  831. The default in Borg is lz4, which is fast enough to not use significant CPU time
  832. in most cases, but can only achieve modest compression. It still compresses
  833. easily compressed data fairly well.
  834. Borg also offers zstd, zlib and lzma compression, choose wisely.
  835. Which choice is the best option depends on a number of factors, like
  836. bandwidth to the repository, how well the data compresses, available CPU
  837. power and so on.