Borg: Difference between revisions

From DWIKI
Tony (talk | contribs)
Tony (talk | contribs)
Tag: wikieditor
 
(16 intermediate revisions by the same user not shown)
Line 5: Line 5:


*[https://borgbackup.readthedocs.io/en/stable/ Homepage]  
*[https://borgbackup.readthedocs.io/en/stable/ Homepage]  
*[https://borgbackup.readthedocs.io/en/stable/faq.html Borg FAQ]
*[https://github.com/borgbackup/borg/issues/392 support keyring for passphrase storage]  
*[https://github.com/borgbackup/borg/issues/392 support keyring for passphrase storage]  
*[https://ci.appveyor.com/project/borgbackup/borg/build/artifacts Borg on windows]  
*[https://ci.appveyor.com/project/borgbackup/borg/build/artifacts Borg on windows]  
*[https://notabug.org/demure/scripts/src/master/borg_wrap.sh A borg script]
*[https://notabug.org/demure/scripts/src/master/borg_wrap.sh A borg script]
*[https://github.com/borgbackup/borg/issues/6602 About upgrading to borg 2]
*[https://github.com/borgbackup/borg/issues/6602 About upgrading to borg 2]
*[http://www.elho.net/dev/borg/ Someone did some benchmarking]


=Tools=
=Tools=
Line 14: Line 16:


=HOWTO=
=HOWTO=
==Check repository on server==
borg check --repository-only
does not need key
== Rename repository ==
== Rename repository ==


Line 19: Line 24:
*On client: change previous_location in ~/.cache/borg/*.config  
*On client: change previous_location in ~/.cache/borg/*.config  
*BORG_RELOCATED_REPO_ACCESS_IS_OK=yes  
*BORG_RELOCATED_REPO_ACCESS_IS_OK=yes  
==Delete files/directories from repository==
borg recreate --exclude foo/bar myrepo
After that you might want to run
borg compact myrepe


== Extract with pattern ==
== Extract with pattern ==
Line 25: Line 36:




==Export key==


==Install using pip==
apt-get install libssl-dev python3-cryptography liblz4-dev libzstd-dev libxxhash-dev libacl1-dev
pip install borgbackup==1.2.0


==Mount borg archive==
borg mount
===borg mount not available: no FUSE support, BORG_FUSE_IMPL=pyfuse3,llfuse===
apt install python3-pyfuse3


= FAQ =
= FAQ =
Line 33: Line 54:
A job for borg check
A job for borg check


==Borg list only shows checkpoints==
Means the backup wasn't finished.


==Enter passphrase for key==
==Enter passphrase for key==
Line 41: Line 64:
On CentOS: try installing python34-msgpack?
On CentOS: try installing python34-msgpack?


 
 
'user@borgserver' ?
'user@borgserver' ?


 


 
== Warnings ==
===  Killed stale lock ===


== Error messages ==
== Error messages ==
===nonce: file changed while we backed it up===
"bug", this will go away in borg 2, ignore or exclude for now
===does not look like a Borg cache===
It got corrupted somehow, try
borg delete --cache-only REPO


=== Connection closed by remote host. Is borg working on the server? ===
=== Connection closed by remote host. Is borg working on the server? ===
Line 58: Line 87:
Usually the 'timeout' bit is relevant. Just try again later.
Usually the 'timeout' bit is relevant. Just try again later.
Does the backup or source happen to be pretty big?
Does the backup or source happen to be pretty big?
Also check access rights on the lock file.


=== BlockingIOError: [Errno 11] Resource temporarily unavailable ===
=== BlockingIOError: [Errno 11] Resource temporarily unavailable ===
Line 97: Line 128:


===Remote: Write failed: Broken pipe===
===Remote: Write failed: Broken pipe===
===The 'borgbackup==1.1.3' distribution was not found and is required by the application===
Incomplete install?
===Segment not found, but listed in compaction data===
Try
borg check
and then perhaps
borg check --repair
===Repository path not allowed===
Server is probably using '''--restrict-to-path'''


==Deduplicated size==
==Deduplicated size==

Latest revision as of 14:39, 6 February 2026

Borg backup

Links

Tools

HOWTO

Check repository on server

borg check --repository-only

does not need key

Rename repository

  • On server: rename repository
  • On client: change previous_location in ~/.cache/borg/*.config
  • BORG_RELOCATED_REPO_ACCESS_IS_OK=yes


Delete files/directories from repository

borg recreate --exclude foo/bar myrepo

After that you might want to run

borg compact myrepe

Extract with pattern

borg extract server:repo sh:path/to/files.*


Export key

Install using pip

apt-get install libssl-dev python3-cryptography liblz4-dev libzstd-dev libxxhash-dev libacl1-dev 
pip install borgbackup==1.2.0


Mount borg archive

borg mount

borg mount not available: no FUSE support, BORG_FUSE_IMPL=pyfuse3,llfuse

apt install python3-pyfuse3

FAQ

4 orphaned objects found!

A job for borg check

Borg list only shows checkpoints

Means the backup wasn't finished.

Enter passphrase for key

probably means the BORG_PASSPHRASE

Remote: Using a pure-python msgpack! This will result in lower performance

On CentOS: try installing python34-msgpack?


'user@borgserver' ?


Warnings

Killed stale lock

Error messages

nonce: file changed while we backed it up

"bug", this will go away in borg 2, ignore or exclude for now

does not look like a Borg cache

It got corrupted somehow, try

borg delete --cache-only REPO

Connection closed by remote host. Is borg working on the server?

Usually ssh key problem of it means borg is not installed on the server


Failed to create/acquire the lock

Usually the 'timeout' bit is relevant. Just try again later. Does the backup or source happen to be pretty big?

Also check access rights on the lock file.

BlockingIOError: [Errno 11] Resource temporarily unavailable

windows?


Corrupted segment reference count - corrupted index or hints

For some reason it might help to run

borg check --repository-only

Exception: FD exception occurred

Probably running borg on cygwin, could be ssh key issue. Try

BORG_RSH="ssh -vvv" borg ...

Also check your quotes

Cache, or information obtained from the security directory is newer than repository - this is either an attack or unsafe (multiple repos with same ID)

Something broke during a backup, try (re)moving ~/.config/borg/security/<id> and ~/.cache/borg/<id>.

Prune: Chunk ID missing from chunks index, corrupted chunks index - aborting transaction.

Try

borg check ( --repair )

If check finds no problem, delete cache:

mv ~/.cache/borg ~/.cache/borg_corrupted

ValueError: stats_against: key contained in self but not in master_index.

Try

borg check ( --repair )

BrokenPipeError: [Errno 32] Broken pipe

Remote: Write failed: Broken pipe

The 'borgbackup==1.1.3' distribution was not found and is required by the application

Incomplete install?

Segment not found, but listed in compaction data

Try

borg check

and then perhaps

borg check --repair


Repository path not allowed

Server is probably using --restrict-to-path

Deduplicated size

For single archive: total size of unique chunks for this archive