Commit graph

1077 commits

Author SHA1 Message Date
Milkey Mouse
64793d5c15
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 12:55:32 -07:00
TW
b80dfc727e
Merge pull request #3725 from ThomasWaldmann/issue-3448
set rc=1 when extracting damaged files, fixes #3448
2018-03-25 20:47:37 +02:00
Thomas Waldmann
232f051c10
cleanup: move "processing files" message to expected place
(now possible as we do not lazy load the files cache any more)
2018-03-24 17:04:20 -07:00
Thomas Waldmann
e2f71b5dc3
cleanup: get rid of ignore_inode, replace with cache_mode
ignore_inode == ('i' not in cache_mode)  # i)node
2018-03-24 17:04:20 -07:00
Thomas Waldmann
b1e7e7f90a
cleanup: get rid of Cache.do_files, replace with cache_mode
not do_files == (cache_mode == 'd')  # d)isabled
2018-03-24 17:04:20 -07:00
Thomas Waldmann
91e5e231f1
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-24 17:04:13 -07:00
TW
5b824f54dd
Merge pull request #3722 from ThomasWaldmann/stdin-filename
create: implement --stdin-name, fixes #3533
2018-03-25 00:35:40 +01:00
Thomas Waldmann
1c97efd81e 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-25 00:21:06 +01:00
Thomas Waldmann
dc48377dc6
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-24 16:05:05 -07:00
Thomas Waldmann
01d2f72813 create: implement --stdin-name, fixes #3533 2018-03-24 22:31:23 +01:00
TW
52be21c690
Merge pull request #3704 from ThomasWaldmann/getpass-ux
improve getpass user experience, see #3689
2018-03-20 22:55:06 +01:00
TW
adf9919d3e
Merge pull request #3682 from milkey-mouse/set-prev-location-early
Set cache previous_location on load instead of save (fixes #3304)
2018-03-20 22:43:28 +01:00
Thomas Waldmann
dc78fcf193 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-20 21:21:23 +01:00
TW
105d518191
Merge pull request #3676 from ThomasWaldmann/recompress-docs
recreate --recompress: add metavar, clarify description
2018-03-17 23:51:44 +01:00
TW
788783b91a
Merge pull request #3691 from ThomasWaldmann/test-diff-deleted-empty
add test for issue #3688
2018-03-17 19:20:07 +01:00
Thomas Waldmann
0a46d3330c add test for issue #3688 2018-03-17 18:24:55 +01:00
TW
229114170e
Merge pull request #3679 from ThomasWaldmann/docs-pattern-option
docs: pattern usage clarifications
2018-03-12 15:15:43 +01:00
Milkey Mouse
4098f0f05c
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-10 16:52:42 -08:00
TW
b812472f36
Merge pull request #3674 from ThomasWaldmann/cache-config-validation
borg config --cache: allow validated access to previous_location
2018-03-10 15:51:05 +01:00
Thomas Waldmann
f979349f07 fix borg recreate --progress (broken by previous commit)
fixup for cb7887836a
2018-03-10 15:41:01 +01:00
Rémi Oudin
cb7887836a Fix --progress option. (#3557)
Fix --progress option, fixes #3431
2018-03-10 15:11:08 +01:00
Thomas Waldmann
9b73d31a40 docs: clarify path semantics when matching, fixes #3598 2018-03-09 22:57:37 +01:00
Thomas Waldmann
cf72c9592c docs: add an example for --pattern usage, fixes #3661 2018-03-09 21:37:06 +01:00
Thomas Waldmann
c0f56ed039 recreate --recompress: add metavar, clarify description 2018-03-09 18:33:15 +01:00
Thomas Waldmann
810986f0f5 borg config --cache: allow validated access to previous_location 2018-03-09 17:27:30 +01:00
TW
3e2d5b2b22
Merge pull request #3581 from ThomasWaldmann/borg-config-validation
borg config: add some validation, fixes #3566
2018-03-05 23:40:12 +01:00
TW
763d12c6b8
Merge pull request #3669 from ThomasWaldmann/issue-3551
fix borgfs patterns/paths processing, fixes #3551
2018-03-05 23:39:25 +01:00
TW
814c44de5a
Merge pull request #3666 from ThomasWaldmann/secure-erase-msg
be more clear in secure-erase warning message, fixes #3591
2018-03-05 21:44:45 +01:00
Thomas Waldmann
0e0e6da585 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".
2018-03-05 17:50:53 +01:00
Thomas Waldmann
2d637d8ead borg config: add some validation, fixes #3566
only a few basic checks, it does not prevent all stupidities.
2018-03-05 17:50:06 +01:00
Thomas Waldmann
df9020389c 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.
2018-03-05 17:02:49 +01:00
Thomas Waldmann
fe65ccf95a be more clear in secure-erase warning message, fixes #3591 2018-03-05 15:21:17 +01:00
TW
5ab5fdf821
Merge pull request #3662 from ThomasWaldmann/pattern-parsing
be more helpful when parsing invalid --pattern values
2018-03-05 15:16:59 +01:00
Thomas Waldmann
b2ffb8bd65 make the C compiler happy, fixes #3490
fix a false positive compiler warning about olen being referenced
before assignment (which is not true, see comments in #3490).
2018-03-03 04:07:25 +01:00
Thomas Waldmann
f5ba0fc649 be more helpful when parsing invalid --pattern values
say what the real problem is.
say what is valid.
2018-03-03 03:08:20 +01:00
Thomas Waldmann
4e0f369d0a 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-02-26 11:07:20 +01:00
Thomas Waldmann
246a8d57ee fix erroneously skipped zstd compressor tests, fixes #3606 2018-02-10 20:10:21 +01:00
Alexander 'Leo' Bergolth
74c10e4643 add chunker_params to archive info (at least to json output) 2018-01-25 21:02:39 +01:00
TW
e6539abc63
Merge pull request #3568 from ThomasWaldmann/files-cache-exception-handling
files cache: improve exception handling, fixes #3553
2018-01-21 12:14:11 +01:00
Alexander 'Leo' Bergolth
d8d93363c9 ignore exceptions in scandir_inorder() that might be raised by an implicit syscall inside a DirEntry 2018-01-21 11:16:41 +01:00
Thomas Waldmann
835fede85f fixup: tests 2018-01-20 13:34:46 +01:00
Thomas Waldmann
2493598eef 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.

(cherry picked from commit 423ec4ba1e)
2018-01-20 06:39:48 +01:00
Gianfranco Costamagna
0980d6ac43 fixup allows one to, with suggestions from Dan Christensen 2018-01-03 15:54:52 +01:00
Gianfranco Costamagna
111a19f7fa fix typo: allows to -> allows one to 2018-01-03 11:42:38 +01:00
Gianfranco Costamagna
1a74326b5a borg: fix typo: explicitely -> explicitly 2018-01-03 11:42:30 +01:00
Abogical
7638085b28 Revert copyright year change in shellpattern 2018-01-02 16:59:01 +02:00
Josh Holland
9f400633f2 Correct some confusing error messages from borg init (#3485)
init: more clear exception messages for borg create, fixes #3465

also: refactor
2017-12-29 01:15:07 +01:00
Thomas Waldmann
9b0d0f3127 use patched version of socket.getfqdn(), fixes #3471 2017-12-24 04:46:20 +01:00
Thomas Waldmann
5e4df7782b refactor/move hostname/fqdn related funcs, see #3471
- move stuff to platform.base (should be platform independent according
  to the docs).
- bump platform API version
- parseformat: import fqdn from platform instead of recomputing it

This is not yet fixing #3471, just a preparation for it.
2017-12-24 04:12:02 +01:00
Thomas Waldmann
c5a339384e added BORG_BASE_DIR, s/get_home_dir/get_base_dir/g, docs, fixes #3338
also: sorted env var docs by level
2017-12-23 01:42:18 +01:00