Commit graph

1013 commits

Author SHA1 Message Date
Thomas Waldmann
857c5635dd fixup: output stats in dry-run mode
it will just show nothing was deleted, but one sees how it would look
like.

this is also for consistency with borg prune --dry-run --stats, which
behaves the same.
2018-05-22 17:18:38 +02:00
Thomas Waldmann
ec4ccc0b6b borg delete: implement --dry-run, fixes #3822 2018-05-22 16:58:52 +02:00
Thomas Waldmann
a88a3153ad borg delete: only commit once, fixes #3823
borg delete was slower than required when it deleted multiple archives
as it committed repo and cache once per archive.

borg prune (doing a similar job) is faster as it commits only once for
all deleted archives.

borg delete now also only commits once and also (similar to borg prune)
only outputs a overall statistics for all deleted archives.

log output of borg delete was made similar to borg prune.
2018-05-22 15:29:08 +02:00
TW
7912fbc610
Merge pull request #3803 from ThomasWaldmann/config-repo-without-key
make "borg config repo" possible without key
2018-05-16 18:30:50 +02:00
Thomas Waldmann
959beb867b xattrs: fix borg exception handling on ENOSPC error, fixes #3808 2018-05-11 16:28:45 +02:00
Thomas Waldmann
322b442641 fix borg config --cache (make sure cache gets closed via try/finally) 2018-05-07 23:54:02 +02:00
Thomas Waldmann
697bb36402 fix borg config --cache (minimal change)
this was broken by previous changeset.

now doing just a minimal change for better diff display,
see also next commit.
2018-05-07 23:54:02 +02:00
Thomas Waldmann
d593d17562 borg config repo ... does not need cache/manifest/key, fixes #3802
thus, we should not use the with_repository decorator to set up
the cache / key / manifest.

this enables running borg config on the repo without the key / key
passphrase (the config itself is in plaintext).
2018-05-07 23:54:02 +02:00
Thomas Waldmann
2e1f2e84d7 debug dump-repo-objs should not depend on a manifest obj
thus, we should not use the with_repository decorator to set up
the key as it uses Manifest.load() to set up the key.

if the Manifest is lost, that does not work.

but we can use some arbitrary object to set up the key, so just
do that.
2018-05-02 00:53:56 +02:00
Thomas Waldmann
d671e9acf2 borg check: fixup for "deleting orphaned objs" msgs, fixes #3795
only output msgs if there is actually something to delete.
be more precise, show count of orphaned / superseded objects.
2018-04-28 21:03:08 +02:00
Thomas Waldmann
85bc590c75 borg check: show progress while rebuilding missing manifest, fixes #3787 2018-04-28 19:58:22 +02:00
Thomas Waldmann
e6e1d18f9a more borg check --repair output 2018-04-27 23:57:47 +02:00
TW
0d01b9ae27
Merge pull request #3769 from ThomasWaldmann/fuse-options
FUSE mount options: uid, gid, umask
2018-04-18 12:31:13 +02:00
Thomas Waldmann
eb61c2153b borg mount: support umask= mount option 2018-04-18 12:30:28 +02:00
Thomas Waldmann
f993f0fd49 borg mount: support uid= and gid= mount options
also: refactor popping an option, converting an options value
2018-04-14 15:34:50 +02:00
Thomas Waldmann
d4d5f0c447 update bundled zstd to 1.3.4, fixes #3745 2018-04-13 00:24:29 +02:00
Thomas Waldmann
64aaec6628 BORG_SHOW_SYSINFO=no to hide system information from exceptions
Can be used:
- in case of troubles with the sysinfo code
- by borg backup providers who do not want to show system information
2018-03-29 23:45:01 +02:00
Thomas Waldmann
4f45eb660a remove platform.uname() call, fixes #3732 2018-03-29 22:27:14 +02:00
Thomas Waldmann
1e94211bf5 run platform.* calls within a cleaned env, fixes #3732
also: add exception handler around deprecated platform.linux_distribution() call.
2018-03-29 19:43:37 +02:00
Milkey Mouse
ecc1a9c499
Use same datetime object for {now} and {utcnow} (fixes #3548)
{now} and {utcnow} should point to the same exact momemt, but they don't
because .now() and .utcnow() create two different objects at different
times. Although the difference will be on the order of microseconds on all
but the slowest machines, this bug still tickles my inner pedant...
2018-03-27 19:48:17 -07:00
Thomas Waldmann
f253899066
set rc=1 when extracting damaged files, fixes #3448
- size inconsistencies
- file has all-zero replacement chunks

introduced new BackupError exception. when raised while extracting
files, gets handled via emitting a warning, setting rc=1 and
proceeding to next file.
2018-03-24 20:57:54 -07:00
Thomas Waldmann
1159cd3077 create: implement --stdin-name, fixes #3533
(cherry picked from commit 01d2f72813)
2018-03-24 23:00:54 +01:00
TW
8c40c19508
Merge pull request #3715 from milkey-mouse/getpass-ux-bp1.1
improve getpass user experience (1.1 backport)
2018-03-24 21:35:23 +01:00
Thomas Waldmann
b33fbd6d8c
improve getpass user experience, see #3689
if interactive passphrase query fails and the env vars are not set,
show a clear error message about this.

users often do 'BORG_PASSPHRASE=secret', forgetting the 'export'.
or they use sudo (and not sudo -E).
in both cases, the env vars won't be available for the borg process.
2018-03-24 11:20:55 -07:00
Milkey Mouse
f4e0a5810b
Set previous_location on load instead of save
This caused a really stupid bug with borg config --cache, see
https://github.com/borgbackup/borg/issues/3304#issuecomment-371896766
2018-03-24 11:09:25 -07:00
Thomas Waldmann
cb49431493 skip test if argparse is broken, fixes #3705
the borg command in the test has 0 path arguments.
Our PATH arg is specified with nargs='*', so that should be valid,
but it crashes python 3.4.0 .. 3.4.2. Python >=3.4.3 works.
2018-03-23 23:13:43 +01:00
Thomas Waldmann
8434f8360c fix Archive's checkpoint_interval arg default (300 -> 1800s)
the commandline arg default was already at 1800, so likely this is
only a cosmetic fix.
2018-03-18 14:45:25 +01:00
TW
cbb19ca493
Merge pull request #3672 from ThomasWaldmann/files-cache-non-lazy
non-lazy files cache
2018-03-18 13:58:09 +01:00
Thomas Waldmann
337c86b470 recreate --recompress: add metavar, clarify description
(cherry picked from commit c0f56ed039)
2018-03-17 23:52:44 +01:00
Thomas Waldmann
a48fffad6e borg config --cache: allow validated access to previous_location
(cherry picked from commit 810986f0f5)
2018-03-17 23:49:21 +01:00
Thomas Waldmann
d5917204c3 fix borgfs patterns/paths processing, fixes #3551
Just checking for None in patterns.py (and removing the set_defaults
calls in archiver.py) did not work as other arg parsing code relies on
having an empty list (in .patterns, .paths) to append to.

Thus I stayed away from pattern.py and rather fixed the defaults for
.paths and .patterns in all parsers.

(cherry picked from commit df9020389c)
2018-03-17 23:46:36 +01:00
TW
996a3dc2be
Merge pull request #3699 from ThomasWaldmann/backports-19
Backports 19
2018-03-17 23:43:37 +01:00
Thomas Waldmann
920e144c81 be more clear in secure-erase warning message, fixes #3591
(cherry picked from commit fe65ccf95a)
2018-03-17 21:39:27 +01:00
Thomas Waldmann
1e7c87b23d be more helpful when parsing invalid --pattern values
say what the real problem is.
say what is valid.

(cherry picked from commit f5ba0fc649)
2018-03-17 21:37:40 +01:00
Thomas Waldmann
1db42a58a5 make sure all segment file offsets fit into uint32, fixes #3592
C code and the repo index use uint32 type for segment file offsets,
so when opening a repo and the config max_segment_size is too big,
fail early.

Also disallow setting a too big value via "borg config".

(cherry picked from commit 0e0e6da585)
2018-03-17 21:34:42 +01:00
Thomas Waldmann
e96730ac24 borg config: add some validation, fixes #3566
only a few basic checks, it does not prevent all stupidities.

(cherry picked from commit 2d637d8ead)
2018-03-17 21:33:53 +01:00
Thomas Waldmann
b6ed644d58 docs: clarify path semantics when matching, fixes #3598
(cherry picked from commit 9b73d31a40)
2018-03-17 21:24:19 +01:00
Thomas Waldmann
bdc58c00ed docs: add an example for --pattern usage, fixes #3661
(cherry picked from commit cf72c9592c)
2018-03-17 21:24:08 +01:00
Thomas Waldmann
c3b7d7b60c consider an empty file as different to a non-existing file, fixes #3688 2018-03-17 18:50:51 +01:00
Thomas Waldmann
01beee37a7 add test for issue #3688
(cherry picked from commit 0a46d3330c)
2018-03-17 18:30:44 +01:00
Thomas Waldmann
d3274cd2c9 cleanup: move "processing files" message to expected place
(now possible as we do not lazy load the files cache any more)
2018-03-08 04:21:58 +01:00
Thomas Waldmann
e4125b4b64 cleanup: get rid of ignore_inode, replace with cache_mode
ignore_inode == ('i' not in cache_mode)  # i)node
2018-03-08 04:10:43 +01:00
Thomas Waldmann
c27c98ced0 cleanup: get rid of Cache.do_files, replace with cache_mode
not do_files == (cache_mode == 'd')  # d)isabled
2018-03-08 03:39:38 +01:00
Thomas Waldmann
e9af3c6ab3 read files cache early, init checkpoint timer after that, see #3394
reading the files cache can take considerable amount of time (a user
reported 1h 42min for a 700MB files cache for a repo with 8M files and
15TB total), so we must init the checkpoint timer after that or borg
will create the checkpoint too early.

creating a checkpoint means (among other stuff) saving the files cache,
which will also take a lot of time in such a case, one time too much.

doing this in a clean way required some refactoring:
- cache_mode is now given to Cache initializer and stored in instance
- the files cache is loaded early in _do_open (if needed)
2018-03-08 03:20:56 +01:00
TW
1f84b0810d
Merge pull request #3654 from miek/backport-3633
Backport #3633 to 1.1-maint
2018-03-02 19:34:05 +01:00
Thomas Waldmann
d8cfd91b15 fix borg create never showing M status
the problem was that the upper layer code did not have enough information
about the file, whether it is known or not - and thus, could not decide
correctly whether status should be M)odified or A)dded.

now, file_known_and_unchanged method returns an additional "known"
boolean to fix this.

also: add comment about files cache loading in cache_mode='r'
2018-03-02 15:44:41 +00:00
Thomas Waldmann
44ba0bb319 fix erroneously skipped zstd compressor tests, fixes #3606 2018-03-02 15:44:33 +00:00
TW
b602612a40
Merge pull request #3555 from leo-b/1.1-maint-archive-metadata
add chunker_params to borg archive info (--json)
2018-01-29 17:52:26 +01:00
Thomas Waldmann
21742faf26 fixup: tests
(cherry picked from commit 835fede85f)
2018-01-20 17:13:45 +01:00
Thomas Waldmann
423ec4ba1e files cache: improve exception handling, fixes #3553
now deals with:
- corrupted files cache (truncated or modified not by borg)
- inaccessible/unreadable files cache
- missing files cache

The latter fix is not sufficient, the cache transaction processing
would still stumble over expected, but missing files in the cache.
2018-01-20 06:36:54 +01:00