Commit graph

43 commits

Author SHA1 Message Date
Thomas Waldmann
4b339f5d69 cosmetic source cleanup (flake8) 2016-01-30 21:32:45 +01:00
Thomas Waldmann
7773e632db fix some minor cosmetic code/docs issues 2016-01-30 00:01:13 +01:00
Thomas Waldmann
6d615ec30a change encryption to be on by default (repokey mode)
it's 2015, let's be safe-by-default and unsafe-as-option.

also: show default mode in builtin help
2016-01-24 15:44:09 +01:00
Thomas Waldmann
fc52101d46 suppress unneeded exception context (PEP 409) 2016-01-24 15:36:04 +01:00
Thomas Waldmann
4444113414 remove misc. compat code not needed for py 3.4+ 2016-01-24 15:16:05 +01:00
Thomas Waldmann
4d73f3cdb9 implement and use context manager for RepositoryCache, fixes #548 2016-01-17 00:30:00 +01:00
Thomas Waldmann
e68b800d01 remove unused "repair" rpc method
there is no such method in the code.
we use "check" method to repair the repo, so maybe this was left over
from a time when repair was separate from check.
2016-01-16 18:58:52 +01:00
Thomas Waldmann
170f847e74 unset LD_LIBRARY_PATH before invoking ssh, hopefully fixes #514 2016-01-11 02:08:58 +01:00
Thomas Waldmann
0c166898bf fix python 3.2 str.splitlines() compatibility issue 2015-12-13 00:51:39 +01:00
Thomas Waldmann
942120997e log remote exceptions, add remote sysinfo 2015-12-12 22:45:29 +01:00
Thomas Waldmann
2df0bb1f83 remote stderr: keep line endings as is
so even the \r trick works for overwriting the same line.
2015-12-12 22:15:08 +01:00
Thomas Waldmann
2e2e145372 sane remote logging, remote stderr, fixes #461 2015-12-12 22:15:08 +01:00
Thomas Waldmann
229512b6f5 determine log level from the logger, so it works with logging.conf also 2015-12-12 22:15:08 +01:00
Thomas Waldmann
eab60cce99 pass through some global options from client to server
new: logging level options
refactored:
- umask option and remote_path
- cleanly separated ssh command from borg command
2015-12-12 22:15:08 +01:00
Thomas Waldmann
0c076ad114 compact_segments: save_space -> free unused segments quickly
as soon as one target segment is full, it is a good time to commit it and remove the source segments
that are already completely unused (because they were transferred int the target segment).

so, for compact_segments(save_space=True), the additional space needed should be about 1 segment size.

note: we can't just do that at the end of one source segment as this might create very small
target segments, which is not wanted.
2015-12-08 18:36:41 +01:00
Thomas Waldmann
6d083c0695 increase rpc protocol version to 2
this is needed because due to the locking improvements, some rpc calls' signature changed slightly.
2015-12-03 17:50:37 +01:00
Thomas Waldmann
38994c78fc implement borg break-lock REPO command, fixes #157
due to borg's architecture, breaking the repo lock needs first creating a repository object.
this would usually try to get a lock and then block if there already is one.
thus I added a flag to open without trying to create a lock.
2015-11-21 20:50:53 +01:00
Thomas Waldmann
f19e95fcf7 implement --lock-wait, support timeout for UpgradableLock, fixes #210
also: simplify exceptions / exception handling
2015-11-21 15:34:51 +01:00
Antoine Beaupré
f13dd6e579 completely remove have_cython() hack
this was making us require mock, which is really a test component and
shouldn't be part of the runtime dependencies. furthermore, it was
making the imports and the code more brittle: it may have been
possible that, through an environment variable, backups could be
corrupted because mock libraries would be configured instead of real
once, which is a risk we shouldn't be taking.

finally, this was used only to build docs, which we will build and
commit to git by hand with a fully working borg when relevant.

see #384.
2015-11-13 10:40:53 -05:00
TW
f651b014e6 Merge pull request #350 from ThomasWaldmann/fix-307
prettier connection closed message, fixes #307
2015-10-31 23:19:26 +01:00
Thomas Waldmann
1740384763 prettier connection closed message, fixes #307 2015-10-31 22:41:08 +01:00
Thomas Waldmann
762fdaadd8 prettier error messages, fixes #57
subclasses of "Error": do not show traceback
(this is used when a failure is expected and has rather trivial reasons and usually
does not need debugging)

subclasses of "ErrorWithTraceback": show a traceback
(this is for severe and rather unexpected stuff, like consistency / corruption issues
or stuff that might need debugging)

I reviewed all the Error subclasses whether they fit into the one or other class.

Also: fixed docstring typo, docstring formatting
2015-10-31 22:23:32 +01:00
Antoine Beaupré
80e53fb66d it's a function, call it as such 2015-10-08 17:16:11 -04:00
Antoine Beaupré
a869ab0702 try to fix RTD build *again* *again* 2015-10-08 17:03:35 -04:00
Thomas Waldmann
a4967ec582 ssh_cmd: fix wrong caller, fixes #255 2015-10-07 03:32:55 +02:00
Antoine Beaupré
a7b70d87cd complete test coverage for SSH args parsing 2015-10-05 19:22:33 -04:00
Antoine Beaupré
a0ef4e25dd add support for arbitrary SSH commands (attic#99)
while SSH options can be specified through `~/.ssh/config`, some users
may want to use a completely different SSH command for their backups,
without overriding their $PATH variable. it may also be easier to do
ad-hoc configuration and tests that way.

plus, the POLA tells us that users expects something like this to be
supported by commands that talk to ssh. it is supported by rsync, git
and so on.
2015-10-05 18:54:00 -04:00
Antoine Beaupré
43a65933f7 move ssh generation code to a stub, add unit test 2015-10-05 18:51:20 -04:00
Antoine Beaupré
de2a811606 move RemoteRepository defaults to the class
the reasoning behind this is that we may need to test a
RemoteRepository setup outside of the main archiver routines, which
the current default location makes impossible

by moving the umask and remote_path remotes into the RemoteRepository
the (reasonable) defaults are available regardless of the (currently
obscure) initialisation routine, and make unit tests easier to develop
and support
2015-10-05 18:45:57 -04:00
Thomas Waldmann
8300efb1db remote: pragma: no cover for the stuff we can't test 2015-08-12 04:28:31 +02:00
Thomas Waldmann
175a6d7b04 simplify umask code
in a similar way as the remote_path code was implemented:
just patch the RemoteRepository class object
2015-08-04 12:31:06 +02:00
Thomas Waldmann
71646249cb implement --remote-path to allow non-default-path borg locations 2015-08-04 09:53:26 +02:00
Thomas Waldmann
9f1d92c993 implement --umask M
affects local and remote umask, secure by default M == 077
2015-08-03 23:48:56 +02:00
Thomas Waldmann
195545075a repo delete: add destroy to allowed rpc methods, fixes issue #114
also: add test, automate YES confirmation for testing
2015-07-26 17:38:16 +02:00
Thomas Waldmann
cc88d174af fix typos 2015-07-15 11:14:53 +02:00
Thomas Waldmann
b644565546 repo key mode (and deprecate passphrase mode), fixes #85
see usage.rst change for a description and why this is needed
2015-07-15 00:01:07 +02:00
Thomas Waldmann
bd354d7bb4 create a RepositoryCache implementation that can cope with any amount of data, fixes attic #326
the old code blows up with an integer OverflowError when the cache file goes beyond 2GiB size.
the new code just reuses the Repository implementation as a local temporary key/value store.

still an issue: if the place where the temporary RepositoryCache is stored (usually /tmp) can't
cope with the cache size and runs full.

if you copy data from a fuse mount, the cache size is the copied deduplicated data size.
so, if you have lots of data to extract (more than your /tmp can hold), rather do not use fuse!

besides fuse mounts, this also affects attic check and cache sync (in these cases, only the
metadata size counts, but even that can go beyond 2GiB for some people).
2015-07-12 00:18:49 +02:00
TW
4b81f380f8 Merge pull request #88 from ThomasWaldmann/py3style
style and cosmetic fixes, no semantic changes
2015-07-11 18:39:42 +02:00
Thomas Waldmann
0580f2b4eb style and cosmetic fixes, no semantic changes
use simpler super() syntax of python 3.x

remove fixed errors/warnings' codes from setup.cfg flake8 configuration

fix file exclusion list for flake8
2015-07-11 18:31:49 +02:00
Thomas Waldmann
a59211f295 use borg-tmp as prefix for temporary files / directories
also: remove some unused temp dir. code
2015-07-11 17:22:12 +02:00
Thomas Waldmann
2743ab1593 better Exception msg if there is no Borg installed on the remote repository server
(still a bit ugly to get even 2 tracebacks)
2015-06-18 23:18:05 +02:00
Thomas Waldmann
5e98400a5a fix all references to package name
use relative imports if possible
reorder imports (1. stdlib 2. dependencies 3. borg 4. borg.testsuite)
2015-05-22 19:21:41 +02:00
Thomas Waldmann
78bfc58b47 rename package directory to borg 2015-05-22 17:48:54 +02:00
Renamed from attic/remote.py (Browse further)