1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-25 07:23:28 +00:00
Commit graph

7917 commits

Author SHA1 Message Date
David Rambo
ee0ca13ab5 Update help docs to reflect support for alternative grouping in shell-style patterns 2023-05-31 16:57:31 -07:00
David Rambo
4efc7cd0bd Add support and tests for shell-style alternatives
Code review fixes

Remove empty line
2023-05-31 15:38:05 -07:00
TW
87b74f3b0d
Merge pull request #7607 from ThomasWaldmann/new-remote-logging
new remote and progress logging, cleanups
2023-05-30 00:14:23 +02:00
Thomas Waldmann
e2ea5cf164
tests: fix usage of .reopen()
also:
add missing param to RemoteRepositoryTestCase.open method, but ignore it.
2023-05-29 23:02:42 +02:00
Thomas Waldmann
48c7879887
RemoteRepository: add .close method
- tears down logging (so no new log output is generated afterwards)
- sends all queued log output
- then returns

also: make stdin_fd / stdout_fd instance variables
2023-05-29 22:40:55 +02:00
Thomas Waldmann
f84951b53c
add logging debugging functionality 2023-05-29 22:40:53 +02:00
Thomas Waldmann
ac4b5c35da
borg serve: shutdown server after sending all queued log records 2023-05-29 22:40:52 +02:00
Thomas Waldmann
746cef1cba
teardown logging in exec_cmd
for normal borg command invocation:
- logging is set up in Archiver.run
- the atexit handler calls logging.shutdown when process terminates

for tests:
- Archiver.run called by exec_cmd
- no atexit handler executed as process lives on
- borg.logger.teardown (calls shutdown and configured=False) now
  called in exec_cmd
2023-05-29 22:40:50 +02:00
Thomas Waldmann
dac4609468
remove_handlers 2023-05-29 22:40:49 +02:00
Thomas Waldmann
c3a4568870
channel progress output via logging system
- simplify progress output (no \r, no terminal size related tweaks)
- emit progress output via the logging system (so it does not use stderr
  of borg serve)
- progress code always logs a json string, the json has all needed
  to either do json log output or plain text log output.
- use formatters to generate plain or json output from that.
- clean up setup_logging
- use a StderrHandler that always uses the **current** sys.stderr
- tweak TestPassphrase to not accidentally trigger just because of seeing 12 in output
2023-05-29 22:40:47 +02:00
Thomas Waldmann
0be545dc45
remove ProgressIndicatorEndless (not used) 2023-05-29 22:40:45 +02:00
Thomas Waldmann
e351e67aee
RepositoryServer: do not use stderr for logging, see #7604
Instead, install a handler that sends the LogRecord dicts to a queue.
That queue is then emptied in the borg serve main loop and
the LogRecords are sent msgpacked via stdout to the client,
similar to the RPC results.

On the client side, the LogRecords are recreated from the
received dicts and fed into the clientside logging system.

As we use msgpacked LogRecord dicts, we don't need JSON for
this purpose on the borg serve side any more.
On the client side, the LogRecords will then be either formatted
as normal text or as JSON log output (by the clientside log
formatter).
2023-05-29 22:40:42 +02:00
TW
ca68dd2565
Merge pull request #7614 from ThomasWaldmann/upgrade-cython-master
development.lock.txt: upgrade cython to 0.29.35, misc. other upgrades (master)
2023-05-29 15:46:58 +02:00
TW
326cf7b46a
Merge pull request #7609 from nain-F49FF806/master-clear-empty-dirs
Add function to clear empty directories at end of compact process.
2023-05-29 15:32:11 +02:00
Thomas Waldmann
8bbef3b672
development.lock.txt: upgrade cython to 0.29.35, misc. other upgrades 2023-05-29 15:18:50 +02:00
Thomas Waldmann
6ae23bc0d7
fix typo 2023-05-29 15:04:30 +02:00
nain
4a7a5b2253 Add function to clear empty directories at end of compact process.
Compact moves data to new segments, and then removes the old segments.
When enough segments are moved, directories holding the now cleared segments
may thus become empty.

With this commit any empty directories are cleared after segments compacting.
Fixes #6823
2023-05-28 01:48:32 -04:00
TW
00e19d047d
Merge pull request #7608 from nain-F49FF806/master-data-scandir-unify-function
unify scanning and listing of segment dirs / segment files and apply good practices
2023-05-27 20:48:01 +02:00
nain
ffe237ce0c unify scanning and listing of segment dirs / segment files and apply good practices
+ os.scandir instead of os.listdir
  Improved speed and added flexibility with attributes (name, path, is_dir(), is_file())
+ use is_dir / is_file to make sure  we're reading only dirs / files respectively
+ Filtering to particular start, end index range built in
+ Move value bounds of segment (index) into constants module and use them instead

Resolves #7597

(forward patch from commits c9f35a16e9bf9e7073c486553177cef79ff1cb06^..edb5e749f512b7737b6933e13b7e61fefcd17bcb)
2023-05-27 07:54:32 -04:00
TW
85b6126629
Merge pull request #7605 from ThomasWaldmann/fix-_resolve_path
fix borg.remote._resolve_path
2023-05-24 17:32:38 +02:00
Thomas Waldmann
89297398c4
fix borg.remote._resolve_path
this used to call get_base_dir (and would have needed
legacy=True now to work like expected).

rather implemented the desired behaviour locally and
got rid of the legacy call (which was a bit strange
anyway as it also considered BORG_BASE_DIR, which is
unexpected when resolving ~).
2023-05-24 17:01:45 +02:00
TW
fbb60140ac
Merge pull request #7603 from ThomasWaldmann/remove-legacy
borg.remote: remove legacy
2023-05-24 16:38:18 +02:00
Thomas Waldmann
90c6b7f794
remote exceptions: simplify sysinfo processing
in the sysinfo function, there is a way to suppress
all sysinfo output via an env var and just return an
empty string.

so we can expect it is always in unpacked, but it
might be the empty string.
2023-05-24 15:30:20 +02:00
Thomas Waldmann
2331341b74
simplify handle_error 2023-05-24 14:38:30 +02:00
Thomas Waldmann
4b796a7337
remote repos: remove support for borg < 1.1.0 ($LOG, logging setup)
log output:

always expect json, remove $LOG format support.

we keep limited support for unstructured format also,
just not to lose anything from remote stderr.
2023-05-24 14:38:24 +02:00
Thomas Waldmann
51177b9f06
remote repos: remove support for borg < 1.1.0 (exceptions)
exception infos:
ancient borg gave only limited infos about exceptions,
but recent ones give more.
2023-05-24 02:13:30 +02:00
Thomas Waldmann
591d8efac4
remote repos: remove support for borg < 1.1.0 (rpc data format, version)
rpc format:
ancient borg used tuples in the rpc protocol,
but recent ones use easier-to-work-with dicts.

version info:
we expect dicts with server/client version now.
2023-05-24 02:13:01 +02:00
TW
0ba40c16fb
Merge pull request #7601 from ThomasWaldmann/security-support-docs-master
Security support docs (master)
2023-05-23 21:10:57 +02:00
Thomas Waldmann
f1152d8209
security: 2.0.x is not yet released, no security support 2023-05-23 21:02:51 +02:00
jetchirag
d07e28db7b
security: 1.1.x is EOL, please upgrade to 1.2.x.
That means I won't make new 1.1.x releases.

In case there would be a major security or other issue,

I might still make a fix commit to the 1.1-maint branch,
where dist package maintainers or other interested
parties could find it.

this ports change 73ee704afa to master.
2023-05-23 21:01:26 +02:00
TW
5e4202e0d2
Merge pull request #7598 from ThomasWaldmann/chunker-params-master
tests: check buzhash chunksize distribution, see #7586
2023-05-23 00:48:59 +02:00
Thomas Waldmann
1fb1cc3ea3
tests: check buzhash chunksize distribution, see #7586 2023-05-23 00:20:28 +02:00
jetchirag
eeefa55428
do not crash for empty archives list in borg rlist date based matching (#7544)
fix ValueError for empty archives list, add a test

Signed-off-by: Chirag Aggarwal <thechiragaggarwal@gmail.com>
2023-05-20 12:30:03 +02:00
TW
ed2bc8a8e0
Merge pull request #7593 from ThomasWaldmann/fix-repo-reopen-master
tests: fix repo reopen (master)
2023-05-20 01:55:58 +02:00
Thomas Waldmann
b9d0f00099
RepositoryTestCaseBase: remove need for "with" after reopen()
setUp enters the context manager, so let's .reopen() leave it.
then create a fresh Repository instance in self.repository and
enter the context manager again. tearDown then will leave that.
2023-05-20 01:31:07 +02:00
Thomas Waldmann
f0e4be76b1
RepositoryTestCaseBase: call __exit__
As we call __enter__ in setUp,
let's call __exit__ in tearDown.
2023-05-20 01:31:05 +02:00
Thomas Waldmann
3d82be0b58
fix RepositoryTestCaseBase.reopen method
"if self.repository" did not work as expected:
- Repository has a __len__ method, so the boolean evaluation was calling that.
- self.repository is also not set to None anywhere.
2023-05-20 01:30:14 +02:00
TW
27f2dffdf8
Merge pull request #7591 from ThomasWaldmann/update-changes-master
update CHANGES
2023-05-19 23:21:21 +02:00
Thomas Waldmann
989017a222
update CHANGES 2023-05-19 22:05:18 +02:00
TW
7a13a98f04
Merge pull request #7583 from ThomasWaldmann/security-dir-in-data
put security infos into data dir, fixes #5760
2023-05-19 21:43:35 +02:00
Thomas Waldmann
989b0a2847
use correct path for security dir when accessing legacy repos (v1)
while on macOS the new and old security dir location is the same path,
this is not the case on e.g. Linux, it could move from .config/borg/security to
.local/share/borg/security .

See #5760.
2023-05-19 21:12:59 +02:00
Thomas Waldmann
c8996aaf12
BORG_DATA_DIR / BORG_SECURITY_DIR docs update 2023-05-18 12:48:47 +02:00
Thomas Waldmann
b8d49a0274
put security infos into data dir, fixes #5760 2023-05-18 12:48:45 +02:00
TW
852172f5ce
Merge pull request #7584 from ThomasWaldmann/test-cosmetics-master
tests: avoid long ids in pytest output
2023-05-18 12:44:26 +02:00
Thomas Waldmann
b0b32e35f5
tests: avoid long ids in pytest output
sometimes the automatically computed IDs are just too long,
so rather give IDs directly or avoid them otherwise.
2023-05-18 05:46:33 +02:00
TW
f5c9f23467
Merge pull request #7582 from ThomasWaldmann/vagrant-updates-master
Vagrant updates master
2023-05-17 01:04:39 +02:00
Thomas Waldmann
7bb644e997
tox: package = editable-legacy, fixes #7580 2023-05-17 01:01:05 +02:00
Thomas Waldmann
0744b7a241
fix test_extract_continue for hfs timestamp granularity 2023-05-17 00:19:42 +02:00
Thomas Waldmann
863bd8a4f4
vagrant: upgrade pythons
e.g. on freebsd13, <3.9.10 has sysconfigdata issues
2023-05-16 23:28:36 +02:00
TW
7e0221d3a2
Merge pull request #7577 from ThomasWaldmann/fix-test-extract-continue
fix test_extract_continue
2023-05-16 19:57:23 +02:00