Commit graph

654 commits

Author SHA1 Message Date
TW
d6590b4e2d Merge pull request #821 from borgbackup/1.0-maint
merge 1.0-maint
2016-04-01 00:19:01 +02:00
TW
8d9dbc6901 Merge pull request #820 from ipha/master
fix incorrect _ns variables
2016-03-31 23:53:19 +02:00
TW
ad57178ad7 Merge pull request #819 from enkore/fix/chunker-io2
Chunker: fix wrong EOF assumption, check for return type
2016-03-31 23:45:47 +02:00
Mitch Bigelow
f406bf7879 fix incorrect _ns variables 2016-03-31 17:31:53 -04:00
Marian Beermann
061bf59d5d Chunker: fix wrong EOF assumption[1], check for return type[2]
[1]
This worked incidentally because OSes tend to return at least one page
worth of data when EOF is not reached. Increasing WINDOW_SIZE beyond
the page size might have lead to data loss.

[2]
If read() of the passed Python object returned something not-bytes,
PyBytes_Size returns -1 (ssize_t) which becomes a very larger number for
memcpy()s size_t.
2016-03-31 22:03:17 +02:00
Alexander Pyhalov
e494d24d6a failing hashindex tests on netbsd, fixes #804 2016-03-31 21:32:27 +02:00
TW
d56e4c5370 Merge pull request #818 from borgbackup/1.0-maint
merge append-only from 1.0 maint
2016-03-31 20:28:49 +02:00
Marian Beermann
effa992d22 append-only mode: use single file for log, disallow check --repair, docs 2016-03-31 18:23:08 +02:00
TW
6841be3684 Merge pull request #789 from enkore/feature-hmac
Replace stdlib hmac, zero-copy decrypt
2016-03-31 18:15:57 +02:00
Lauri Niskanen
9d1a30c08b Add '--sort' option for sorting diff command output
Previously, on 'borg diff', the output always had first the modifications, then
additions, and finally removals. Output may be easier to follow if the various
kinds of changes are interleaved. This commit is a simple solution that first
collects the output lines and sorts them by file path before printing. This new
behavior is optional and disabled by default. It can be enabled with '--sort'
command line option.

This option will be especially useful after the planned multi-threading changes
arrive. Multi-threading may shuffle the archive order of files making diff
output hard to follow without sorting.

Resolves #797.
2016-03-31 18:55:02 +03:00
Marian Beermann
ffc8cf6c97 Append-only mode for repositories
New repository config item, repository.append_only, causes Borg to never
delete or append to existing data files. Hints and indices are handled
as before, old ones are deleted, because they can get quite large, but
are automatically reconstructed: no need to keep them.

When append_only is activated a file /path/to/repo/transactions/<NUMBER>
will be created for every commit.
Deleting all segments <NUMBER+1> and higher will rollback to that commit.

Note that this only influences Borg behaviour. Since repository config
can't be altered remotely (except for repository.key) this can't be
disabled when accessed remotely over SSH with "borg serve" as the
forced command.

This is only a feature to support the use case, and does not replace
appropriate file system permissions or monitoring.

Resolves #809
2016-03-31 17:29:17 +02:00
Ed Blackman
2ab324c03f Add 'x' status for excluded paths (#814)
Makes it easy to see paths excluded by --exclude* options for testing of
regexes, and for ongoing monitoring that files desired for backup aren't
getting excluded accidentally.
2016-03-30 22:38:31 -04:00
TW
5a0f75df9b Merge pull request #806 from pyhalov/804
failing hashindex tests on netbsd, fixes #804
2016-03-28 01:14:00 +02:00
Alexander Pyhalov
a97c9f9e81 failing hashindex tests on netbsd, fixes #804 2016-03-27 17:42:45 +03:00
Marian Beermann
c5bd7f2216 Replace stdlib hmac with OpenSSL, zero-copy decrypt
AESKeyBase.decrypt makes less copies of the data, specifically data[41:],
which copies the payload, is gone. This is possible since this commit
makes our lil' crypto API compatible with simple buffers.

In Cython there is a syntax for creating memoryviews from buffer-enabled
objects, however, it doesn't support read-only buffers. ro_buffer gets
this job done, though, and also does the proper type checking
(by PyBUF_SIMPLE).

Note: msgpack doesn't support memoryviews. Otherwise we could avoid
      copying the en/de-crypted output with the final "return out[:ctl]"

This commit leads to a solid 10-15 % increase in performance of hash-lists
and extract.

The hmac_sha256() function releases the GIL.
2016-03-27 01:12:23 +01:00
Lauri Niskanen
4eba7d38ea Preserve archive order of added and removed files 2016-03-26 23:51:45 +02:00
Lauri Niskanen
1d3e69e4c7 Improve 'borg diff' output format
The main design goals of the new format:
 - One file takes exactly one line of output
 - The format is easy to read with typical, long list of changes
 - Metadata changes are visible and easy to examine
 - Unuseful information is not shown

Resolves #757.
2016-03-26 23:50:03 +02:00
Lauri Niskanen
c405122753 Add option for an explicit sign in sizeof_fmt functions in helpers 2016-03-26 23:49:24 +02:00
TW
db171e998e Merge pull request #777 from enkore/feature-ctxmng
Feature ctxmng: Repository context manager
2016-03-26 21:34:06 +01:00
TW
7225def75c Merge pull request #803 from borgbackup/1.0-maint
merge 1.0 maint
2016-03-26 17:51:12 +01:00
Thomas Waldmann
3e120378e0 fix capitalization, add ellipses, change log level to debug for 2 messages, fixes #798 2016-03-26 14:31:54 +01:00
Marian Beermann
7caec0187f Make Repository a context manager, use decorators for wrapping withs
(Remote)Repository.close() is not a public API anymore, but a private
API. It shall not be used from within other classes than Repository
or it's tests. The proper way is to use a context manager now. However,
for RPC/Remote compatibility with Borg 1.0 it is kept and unchanged.

Repositories are not opened by __init__ now anymore, it is done
by binding it to a context manager. (This SHOULD be compatible both ways
with remote, since opening the repo is handled by a RepositoryServer method)

Decorators @with_repository() and @with_archive simplify
context manager handling and remove unnecessary indentation.
2016-03-23 00:41:15 +01:00
Thomas Waldmann
601313836d Merge branch 'master' of github.com:borgbackup/borg 2016-03-21 16:14:24 +01:00
Thomas Waldmann
de7582a9d7 Merge branch '1.0-maint' 2016-03-21 16:13:08 +01:00
TW
42beb2dc92 Merge pull request #785 from pyhalov/illumos-build-1.0
Fix build on illumos
2016-03-21 16:07:52 +01:00
Alexander Pyhalov
f63be63347 Fix build on illumos 2016-03-21 17:39:55 +03:00
Alexander Pyhalov
e98f823f34 Don't try to backup doors or event ports 2016-03-21 17:35:51 +03:00
TW
2f7d8aaffb Merge pull request #778 from borgbackup/1.0-maint
merge 1.0 maint
2016-03-19 22:02:57 +01:00
Thomas Waldmann
f486a6772c do not sleep for >60s while waiting for lock, fixes #773 2016-03-19 21:19:30 +01:00
Marian Beermann
9cf129935e borg diff help: clarify: for new archives different chunker params still require content compare 2016-03-18 15:42:32 +01:00
Marian Beermann
e64d91b735 Update borg diff help message regarding --same-chunker-params 2016-03-18 13:30:39 +01:00
Marian Beermann
343d84b427 ItemFormatter: group keys in help output 2016-03-18 13:29:49 +01:00
Marian Beermann
89120a9843 Update usage docs 2016-03-18 12:17:57 +01:00
TW
77dfcbc31d Merge pull request #763 from enkore/issue-761
fix links failing for extracting subtrees, fixes #761
2016-03-18 00:46:39 +01:00
Marian Beermann
9211d0fa18 borg extract: fix links failing for sub-tree extractions
fixes #761
2016-03-17 22:39:57 +01:00
TW
15c20dcd37 Merge pull request #759 from nachtgeist/public
refactor get_home_dir
2016-03-17 18:11:19 +01:00
Marian Beermann
4151db270c Redo borg list
- This is compatible except for {formatkeys}, which has been replaced
  by "borg list --help"
- --list-format is deprecated, use --format instead
  (using deprecated arguments will print a warning and an exit code of 1)
- borg list now supports the usual [PATH [PATHS…]] syntax and excludes
- Additional keys: csize, num_chunks, unique_chunks, NUL
- Supports guaranteed_available hashlib hashes
  (to avoid varying functionality depending on environment)
  (also, the other hashes are really obscure, like MD-4)
2016-03-17 17:32:23 +01:00
Daniel Reichelt
6dd5f6a179 refactor retrieval of a user's home into get_home_dir() 2016-03-17 14:35:56 +01:00
Daniel Reichelt
e1f6a34820 provide wrapper for borg mount, fixes #743
- add archiver.main_mount()

- provide borgfs behaviour when the monolithic binary is called via a
  symlink called borgfs

- docs: update usage of mount subcommand, provide examples for borgfs and
  add symlink creation to standalone binary installation

- run build_usage

- add entry point in setup.py

- patch helpers.py:get_keys_dir() to allow mounting fstab entries with
  "user" option set

  Without this, setuid() called at some point by mount changes the HOME
  environment variable to '/root' and os.expanduser('~') would return
  '/root' as well, thus the mount would fail with
 	 PermissionError: [Errno 13] Permission denied: '/root/.config'
  After setuid(), the HOME variable stays intact, so we still can
  explicitly query USER's home.

  Also, os.path.expanduser() behaves differently for '~' and '~someuser'
  as parameters: when called with an explicit username, the possibly set
  environment variable HOME is no longer respected. So we have to check if
  it is set and only expand the user's home directory if HOME is unset.

- add myself to AUTHORS
2016-03-17 01:40:17 +01:00
TW
f0cb6379b7 Merge pull request #740 from enkore/feature-diff
borg diff: find different files between archives
2016-03-17 00:23:23 +01:00
Marian Beermann
489eb78cbb Possible fix to silently skipping EIO and the like? #748 2016-03-16 01:32:48 +01:00
TW
b4b3986927 Merge pull request #752 from enkore/feature-ignore-inode
Feature --ignore--inode, fixes #628
2016-03-15 20:40:51 +01:00
Marian Beermann
c16ed82285 borg create --ignore-inode: add explanatory text to long help 2016-03-15 19:08:36 +01:00
Marian Beermann
db9515ee7a borg diff: wording of --numeric-owner help text 2016-03-15 18:23:49 +01:00
Marian Beermann
2f2d88b584 borg diff: use proper validator for archive name (ARCHIVE2) 2016-03-15 18:23:49 +01:00
enkore
26fe2a35cd borg diff: find different files between archives 2016-03-15 18:23:49 +01:00
Marian Beermann
57c2d03e3e borg create: add --ignore-inode option
This is mainly meant for use with network file systems like sshfs and
possibly CIFS, which don't convey proper inode numbers.
2016-03-15 15:39:12 +01:00
TW
5e5bab3239 Merge pull request #742 from ThomasWaldmann/improve-prune-log
format_archive: also output archive id, fixes #731
2016-03-15 15:09:07 +01:00
TW
84370e1b50 Merge pull request #741 from ThomasWaldmann/show_version
implement --show-version: shows/logs the borg version, fixes #725
2016-03-15 15:08:12 +01:00
TW
347615b5e1 Merge pull request #749 from enkore/issue-748
fix to silently skipping EIO and the like #748
2016-03-15 15:07:19 +01:00