This special remote type accesses annexed files stored in a borg repository.
Unlike most special remotes, git-annex cannot be used to store annexed
files in this special remote. You store files by using borg create to
store the git-annex repository in borg. Then git-annex sync will learn
about the annexed files that are stored in the borg repository.
setup example
# borg init --encryption=keyfile /path/to/borgrepo
# git annex initremote borg type=borg borgrepo=/path/to/borgrepo
# borg create /path/to/borgrepo::{now} `pwd`
# git annex sync borg
configuration
These parameters can be passed to git annex initremote to configure the
remote:
borgrepo- The location of a borg repository, eg a path, oruser@host:pathfor ssh access.subdir- The subdirectory within the borg repository where git-annex should look for annex object files. The default is to look through the whole borg repository.This is useful to avoid learning about annex objects in the borg repository that belong to unrelated git-annex repositories. It can also make syncing faster.
appendonly- You could use borg to delete content from the repository at any time, so this defaults to "no", which makes the remote be untrusted. If you set to "yes", you must take care to avoid using commands likeborg delete,borg prunewith the borg repository.
avoid archive name reuse
Borg repositories contain archives, and git-annex assumes that, once
created, the content of an archive does not change. So if you delete an
archive and then create a new archive with the same name, it will confuse
git-annex about what is contained in the borg repository. So will using
borg recreate to remove files from an archive.
When I tried running
git annex sync borgon a large (~6T) borg repo with many archives, git-annex spun until it used 52G of memory, then got OOM-killed.I don't know if this is a memory leak or just trying to load too much, but it seems like this is a thing you should be able to do on a machine with 64G of RAM.
I have opened a bug for that issue, ?borg special remote memory usage high for large borg repo.
It would be good if you could followup there with details.
I can't follow the link as it appears to be broken, so couldn't look whether there was a fix for the high ram usage.
My borg repo is only about 100 GB, but it has a large amount of files:
The first sync action after my first borg backup (only one snapshot) is currently using about 26 GB of my 32 GB of RAM and possibly still climbing.
With borg 2.0 on the horizon, I was wondering how support for that would look should that be planned.
With how much has changed and the necessity to create new repos, it might make the most sense to create a separate borg2 remote, but I have now idea. Mostly just curious if there are any plans for that at all.
I have not looked at borg 2 in any detail, but it seems they are trying to keep the CLI to some extent the same. So it seems it would depend on whether CLI changes break something git-annex relies on.
I'd treat any incompatability as a bug or todo on the git-annex side, so if you try it and find problems, please report them.