Commit graph

173 commits

Author SHA1 Message Date
Thomas Waldmann
6c2c51939d Manifest: use limited unpacker 2017-06-25 23:36:28 +02:00
Ed Blackman
9c5425dda8 Split up interval parsing from filtering for --keep-within
Fixes #2610

Parse --keep-within argument early, via new validator method interval
passed to argparse type=, so that better error messages can be given.

Also swallows ValueError stacktrace per the comment in the old code that
including it wasn't desirable.
2017-06-25 12:10:13 -04:00
TW
7df6597fa1 Merge pull request #2654 from enkore/f/no-cache-sync
create: --no-cache-sync
2017-06-18 03:22:06 +02:00
Marian Beermann
125b02c5c8 docs: list: fix unintended block quote 2017-06-18 02:10:10 +02:00
Marian Beermann
8aa745ddbd create: --no-cache-sync 2017-06-18 02:01:26 +02:00
Thomas Waldmann
72ef24cbc0 hashindex: implement KeyError 2017-06-17 23:25:32 +02:00
Marian Beermann
e189a4d302 info: use CacheSynchronizer & HashIndex.stats_against 2017-06-13 14:34:10 +02:00
Marian Beermann
5f5371f0b1 implement --glob-archives/-a 2017-06-11 12:15:12 +02:00
textshell
86363dcd4b Merge pull request #2648 from textshell/feature/mandatory-features-master
Add minimal version of in repository mandatory feature flags. (master)
2017-06-10 17:50:28 +02:00
enkore
13f396d5ad Merge pull request #2638 from enkore/f/fastcachesync-minify
Compact chunks.archive.d
2017-06-10 17:13:25 +02:00
enkore
d06ee5648c Merge pull request #2572 from enkore/f/fastcachesync
Improve cache sync speed
2017-06-10 17:12:51 +02:00
Martin Hostettler
b8ad8b84da Cache: Wipe cache if compatibility is not sure
Add detection of possibly incompatible combinations
of the borg versions maintaining the cache and the featues used.
2017-06-10 11:42:48 +02:00
Martin Hostettler
1176a1c4e4 permit manifest version 2 as well 1 one. 2017-06-09 23:22:18 +02:00
Martin Hostettler
fd0250d34a Add minimal version of in repository mandatory feature flags.
This should allow us to make sure older borg versions can be cleanly
prevented from doing operations that are no longer safe because of
repository format evolution. This allows more fine grained control than
just incrementing the manifest version. So for example a change that
still allows new archives to be created but would corrupt the repository
when an old version tries to delete an archive or check the repository
would add the new feature to the check and delete set but leave it out
of the write set.

This is somewhat inspired by ext{2,3,4} which uses sets for
compat (everything except fsck), ro-compat (may only be accessed
read-only by older versions) and features (refuse all access).
2017-06-09 23:13:31 +02:00
Andrea Gelmini
e4247cc0d2 Fix typos 2017-06-09 16:49:30 +02:00
Marian Beermann
6e011b9354 cache: compact hashindex before writing to chunks.archive.d 2017-06-09 12:23:26 +02:00
Marian Beermann
3f8a0221ee Revert "move chunker to borg.algorithms"
This reverts commit 956b50b29c.

# Conflicts:
#	setup.py
#	src/borg/archive.py
#	src/borg/helpers.py
2017-06-07 23:51:42 +02:00
Marian Beermann
1135114520 helpers: truncate_and_unlink doc 2017-06-06 19:52:08 +02:00
Marian Beermann
ed0a5c798f platform.SaveFile: truncate_and_unlink temporary
SaveFile is typically used for small files where this is not
necessary. The sole exception is the files cache.
2017-06-06 18:13:20 +02:00
Marian Beermann
740898d83b CacheSynchronizer 2017-06-02 17:43:14 +02:00
Marian Beermann
38ed9a20af key file names: limit to 100 characters (not bytes) 2017-05-25 12:36:45 +02:00
Marian Beermann
4b8a04b5e7 key file names: remove colons from host name 2017-05-25 12:32:42 +02:00
enkore
2dcbe02e5a Merge pull request #2528 from ThomasWaldmann/follow-symlinks
document follow_symlinks requirements, check libc, fixes #2507
2017-05-25 09:26:09 +02:00
Thomas Waldmann
0d406e7baf use _host to store host/ipv4/ipv6
for ipv6, it includes the outer square brackets.

the host property strips any outer square brackets.
2017-05-23 03:09:57 +02:00
Benedikt Neuffer
d99aff1276 ipv6 address support
also: Location: more informative exception when parsing fails
2017-05-23 02:08:44 +02:00
Thomas Waldmann
efec00b39c use stat with follow_symlinks=False
should be equivalent to using os.lstat() before.
2017-05-22 17:54:42 +02:00
Thomas Waldmann
094376a8ad require and use chown with follow_symlinks=False
should be equivalent to using os.lchown() before.
2017-05-22 17:54:42 +02:00
Thomas Waldmann
b484c79bc2 document follow_symlinks requirements, check libc, fixes #2507 2017-05-22 17:54:42 +02:00
Marian Beermann
fc105b49b1 fix --progress and logging in general for remote 2017-05-20 12:54:48 +02:00
Marian Beermann
293324810b introduce popen_with_error_handling to handle common user errors
(without tracebacks)
2017-05-17 10:54:39 +02:00
enkore
5788219ff4 borg export-tar (#2519) 2017-05-17 00:09:41 +02:00
enkore
badc79c323 Merge pull request #2488 from enkore/issue/2439
list: --json-lines for archive contents
2017-05-07 22:31:58 +02:00
Marian Beermann
2a22f93e44 list: JSON lines output for archive contents 2017-05-05 15:49:56 +02:00
Marian Beermann
ba5d6693f9 --json: fix encryption[mode] not being the cmdline name 2017-05-05 14:38:21 +02:00
Marian Beermann
a976e11a63 create crypto package with key, keymanager, low_level 2017-05-02 20:49:27 +02:00
Marian Beermann
956b50b29c move chunker to borg.algorithms 2017-05-02 19:15:01 +02:00
Marian Beermann
580496b592 create patterns module 2017-05-01 22:20:33 +02:00
Thomas Waldmann
de76a6b821 embrace y2038 issue to support 32bit platforms 2017-04-24 18:50:33 +02:00
Mark Edgington
798127f636 allow excluding parent and including child, fixes #2314
This fixes the problem raised by issue #2314 by requiring that each root
subtree be fully traversed.

The problem occurs when a patterns file excludes a parent directory P later
in the file, but earlier in the file a subdirectory S of P is included.
Because a tree is processed recursively with a depth-first search, P is
processed before S is.  Previously, if P was excluded, then S would not even
be considered.  Now, it is possible to recurse into P nonetheless, while not
adding P (as a directory entry) to the archive.

With this commit, a `-` in a patterns-file will allow an excluded directory
to be searched for matching descendants.  If the old behavior is desired, it
can be achieved by using a `!` in place of the `-`.

The following is a list of specific changes made by this commit:

 * renamed InclExclPattern named-tuple -> CmdTuple (with names 'val' and 'cmd'), since it is used more generally for commands, and not only for representing patterns.
 * represent commands as IECommand enum types (RootPath, PatternStyle, Include, Exclude, ExcludeNoRecurse)
 * archiver: Archiver.build_matcher() paths arg renamed -> include_paths to prevent confusion as to whether the list of paths are to be included or excluded.
 * helpers: PatternMatcher has recurse_dir attribute that is used to communicate whether an excluded dir should be recursed (used by Archiver._process())
 * archiver: Archiver.build_matcher() now only returns a PatternMatcher instance, and not an include_patterns list -- this list is now created and housed within the PatternMatcher instance, and can be accessed from there.
 * moved operation of finding unmatched patterns from Archiver to PatternMatcher.get_unmatched_include_patterns()
 * added / modified some documentation of code
 * renamed _PATTERN_STYLES -> _PATTERN_CLASSES since "style" is ambiguous and this helps clarify that the set contains classes and not instances.
 * have PatternBase subclass instances store whether excluded dirs are to be recursed.  Because PatternBase objs are created corresponding to each +, -, ! command it is necessary to differentiate - from ! within these objects.
 * add test for '!' exclusion rule (which doesn't recurse)
2017-04-12 12:06:18 -04:00
enkore
736a815972 Merge pull request #2342 from ThomasWaldmann/generic-hardlinks
Generic hardlinks
2017-04-05 14:34:29 +02:00
enkore
7255e3b298 Merge pull request #2387 from enkore/f/placeholders-internals
placeholders: deny access to internals and other unspecified stuff
2017-04-05 14:10:30 +02:00
enkore
9a1c1e90c1 Merge pull request #2375 from enkore/buhdf
BORG_HOSTNAME_IS_UNIQUE=yes by default.
2017-04-05 14:09:58 +02:00
Marian Beermann
cc24fa2064 format_line: whitelist instead of checking against blacklist 2017-04-05 13:51:20 +02:00
Thomas Waldmann
8f769a9b24 implement and use hardlinkable() helper 2017-04-05 13:38:27 +02:00
Marian Beermann
1bd381a13a format_line: deny conversions (!r, !s, !a) 2017-04-05 00:09:32 +02:00
Marian Beermann
e2e172c74f format_line: clearer error message for unrecognized placeholder 2017-04-05 00:09:32 +02:00
Marian Beermann
1924e33ef5 format_line: deny access to internal objects 2017-04-05 00:09:31 +02:00
Marian Beermann
2ff75d58f2 remove Chunk() 2017-04-04 00:16:15 +02:00
Marian Beermann
69fb9bd403 remove --compression-from 2017-04-04 00:16:15 +02:00
Marian Beermann
0847c3f9a5 Unify ComprSpec and CompressionSpec; don't instanciate Compressors right away 2017-04-04 00:16:14 +02:00