spslater / borgapi Goto Github PK
View Code? Open in Web Editor NEWWrapper for borgbackup to easily use in code
License: MIT License
Wrapper for borgbackup to easily use in code
License: MIT License
If you start a borgbackup commands which leads to a question, e.g. you have moved the repository. Borgapi stucks, as the questions gets never answered.
Borgbackup supports environment variable to answer the questions "programmatically". https://borgbackup.readthedocs.io/en/stable/usage/general.html#environment-variables -> "Some automatic “answerers” (if set, they automatically answer confirmation questions):"
Borgapi supports setting the environment variables, but I didn't find any hint in documentation to set the environment variables to avoid this situation.
I can imagine 2 possible solutions:
Add a "skip if" check to the test_benchmark_crud
in the borgapi test module to help with rapid testing. This test increases the runtime from ~22 seconds to ~134 seconds. Setting an environment variable (BORGAPI_TEST_BENCHMARK_SKIP
) will cause this test to skip making rapid checks much easier.
Hi
Requirements are listed as:
borgbackup: 1.1.17
python-dotenv: 0.17.1
But when I try to install it asks for fuse. Is that correct?
$ pip install borgapi Collecting borgapi Using cached borgapi-0.5.1-py3-none-any.whl (30 kB) Requirement already satisfied: borgbackup[fuse]==1.1.17 in ./.venv/lib/python3.9/site-packages (from borgapi->-r requirements.txt (line 1)) (1.1.17) Collecting python-dotenv>=0.17.1 Using cached python_dotenv-0.19.0-py2.py3-none-any.whl (17 kB) Requirement already satisfied: packaging in ./.venv/lib/python3.9/site-packages (from borgbackup[fuse]==1.1.17->borgapi->-r requirements.txt (line 1)) (21.0) Collecting llfuse>=1.3.4 Using cached llfuse-1.4.1.tar.gz (774 kB) ERROR: Command errored out with exit status 2: command: /home/larsfp/Downloads/git/borgfrag/.venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-g4us2xwu/llfuse_0d618ef5987a4ac5bba3b0724494d954/setup.py'"'"'; __file__='"'"'/tmp/pip-install-g4us2xwu/llfuse_0d618ef5987a4ac5bba3b0724494d954/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-5e05cjl4 cwd: /tmp/pip-install-g4us2xwu/llfuse_0d618ef5987a4ac5bba3b0724494d954/ Complete output (4 lines): Package fuse was not found in the pkg-config search path. Perhaps you should add the directory containing
fuse.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fuse' found
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/b1/d4/44443fbaac6d5b878da99e7c0948ee93c7934fa3b00e48c5363823b583d0/llfuse-1.4.1.tar.gz#sha256=c29c79d96a5aeab51608cae12594a1bf83576d86232f97341c7f779d413a4ec9 (from https://pypi.org/simple/llfuse/) (requires-python:>=3.5). Command errored out with exit status 2: python setup.py egg_info Check the logs for full command output.
Using cached llfuse-1.4.0.tar.gz (478 kB)
ERROR: Command errored out with exit status 2:
command: /home/larsfp/Downloads/git/borgfrag/.venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-g4us2xwu/llfuse_7834839a4b014859a3a9b268e02c1236/setup.py'"'"'; file='"'"'/tmp/pip-install-g4us2xwu/llfuse_7834839a4b014859a3a9b268e02c1236/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-0cyjmwr_
cwd: /tmp/pip-install-g4us2xwu/llfuse_7834839a4b014859a3a9b268e02c1236/
Complete output (4 lines):
Package fuse was not found in the pkg-config search path.
Perhaps you should add the directory containing fuse.pc' to the PKG_CONFIG_PATH environment variable No package 'fuse' found ---------------------------------------- WARNING: Discarding https://files.pythonhosted.org/packages/5d/3d/970c3fb9fbccfb7338f4b4d9fc1f769f7c886a8821ccc76f4d9c8d437606/llfuse-1.4.0.tar.gz#sha256=cb5dc6052bdd9c19dd15d44cd2876520007029a7733e7b9f0c2022c768e3ca52 (from https://pypi.org/simple/llfuse/) (requires-python:>=3.5). Command errored out with exit status 2: python setup.py egg_info Check the logs for full command output. Using cached llfuse-1.3.8.tar.gz (481 kB) ERROR: No .egg-info directory found in /tmp/pip-pip-egg-info-d_5c2use
Ubuntu 21.04
The borgbackup option "--progress" can be applied to the command, but currently the output of the command is only parsed after the borgbackup command exists.
So the progress output is useless?
I don't know if it would make sense to have an asynchronous interface to borgbackup and you could parse the real time output. (Maybe not feasible as this would change a lot of the interface).
So maybe a hint in the readme would improve the situation
Using the mount command causes the process to exit as it gets daemonized by borg.
Meanwhile borg version 1.2.1 is out and is supporting a new command "compact"
It would be great if borgapi would support it
When trying to export a tar to stdout, it tries to write bytes to a StringIO object. raw_bytes needs to be set to True when the filename is -
(aka, stdout).
When passing multiple values for flags that can be repeated, the parser will treat the list as one argument instead of multiple values.
Example:
ExclusionOptions(exclude=["foo", "bar"], pattern="baz", patterns_from="spam/milk",).parse()
Expected: ['--exclude', 'foo', '--exclude', 'bar', '--pattern', 'baz', '--patterns-from', 'spam/milk']
Actual: ['--exclude', ['foo', 'bar'], '--pattern', ['baz'], '--patterns-from', 'spam/milk']
When running the extract
command with the stdout = True
the _run command errors because it is trying to write to the "buffer" method of a StringIO, which doesn't have one.
Options for fix:
io
package.borgapi
cases into multiple classesStop returning captured output as stdout and stderr. If json output is expected, return it as one struct with relevant key names (eg stats or files).
Move the command specific option data classes out from the method calls and into a master class that houses all of these options. This new master class should live in the options
module and have a way to pass in the command and options to generate the args list.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.