You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there an easy way to retrieve hints (and other) data from an encrypted repository without having the key? I would like to parse the currently used quota on my backup server to send quota warnings to users without needing to enter a passphrase. I also don't want to spend time scrubbing the disk to get an estimated quota that is even slightly wrong.
My quick and dirty way:
def get_borg_repo_hints(repo_path):
import os
from borg.repository import Repository
from borg.helpers import msgpack
repo = Repository(repo_path)
transaction_id = repo.get_index_transaction_id()
hints_path = os.path.join(repo_path, 'hints.%d' % transaction_id)
with open(hints_path, 'rb') as fd:
hints = msgpack.unpack(fd)
return hints
This is of course not very safe, doesn't use locking and doesn't verify the hints file integrity. I could expand this of course, by following the implementation from Repository.prepare_txn() but I don't really want to and don't think it is a good idea to re-implement borg repository handling outside of borg itself.
Is there a better way without digging even deeper and reimplementing even more? (I would prefer to just run borg info --json but this requires a passphrase which I do not have and do not want.)
If not: Would it be feasible to add an option (like --only-unencrypted) to borg info or borg debug that would make it possible to retrieve all information that is not encrypted?
(I know I am working against the borg attack model here. But some data will never be encrypted because it is impossible to combine server enforced repository quotas without the server being able to read/write the used quota value. If it is not encrypted it should not be hard to make use of it.)
The text was updated successfully, but these errors were encountered:
The info is only available after asking for the key.
Yes I can do du -s but the value I get will be different from the way borg counts things. Also it is duplicating information that is already there and it takes time and disk I/O to complete.
I have a way to retrieve it by importing borg but I think it is the only way right now.
Is there an easy way to retrieve hints (and other) data from an encrypted repository without having the key? I would like to parse the currently used quota on my backup server to send quota warnings to users without needing to enter a passphrase. I also don't want to spend time scrubbing the disk to get an estimated quota that is even slightly wrong.
My quick and dirty way:
This is of course not very safe, doesn't use locking and doesn't verify the hints file integrity. I could expand this of course, by following the implementation from
Repository.prepare_txn()
but I don't really want to and don't think it is a good idea to re-implement borg repository handling outside of borg itself.Is there a better way without digging even deeper and reimplementing even more? (I would prefer to just run
borg info --json
but this requires a passphrase which I do not have and do not want.)If not: Would it be feasible to add an option (like
--only-unencrypted
) toborg info
orborg debug
that would make it possible to retrieve all information that is not encrypted?(I know I am working against the borg attack model here. But some data will never be encrypted because it is impossible to combine server enforced repository quotas without the server being able to read/write the used quota value. If it is not encrypted it should not be hard to make use of it.)
The text was updated successfully, but these errors were encountered: