Commit graph

883 commits

Author SHA1 Message Date
Thomas Waldmann
2aa676f85c fix server-side IndexError for 4-arg open() of old clients, fixes #3192
borg 1.1(.0) server didn't support the 4 argument open() calls made
by < 1.0.7 clients.

(cherry picked from commit dbcc870489)
2017-10-22 00:48:51 +02:00
TW
8304b0798a Merge pull request #3199 from ThomasWaldmann/show-excluded-dirs-1.1
show excluded dir with "x" for tagged dirs / caches, fixes #3189
2017-10-20 23:55:57 +02:00
Thomas Waldmann
6d67a9f874 fix crash with relative BORG_KEY_FILE, fixes #3197
(cherry picked from commit 7136e2c93c)
2017-10-20 23:42:35 +02:00
Thomas Waldmann
75004e9065 show excluded dir with "x" for tagged dirs / caches, fixes #3189
(cherry picked from commit 93de42bb25)
2017-10-20 21:29:36 +02:00
TW
40186a3ffc Merge pull request #3185 from ThomasWaldmann/hardlinked-symlink-warning-1.1
remove hardlinked symlinks warning, update docs, fixes #3175
2017-10-17 21:54:25 +02:00
Thomas Waldmann
d535c6a25d remove hardlinked symlinks warning, update docs, fixes #3175
the warning was annoying for people with a lot of such items and
they can not do anything about it anyway.

thus, just document this as a limitation.

(cherry picked from commit e674822888)
2017-10-17 21:39:51 +02:00
Thomas Waldmann
229a117ceb implement --nobsdflags and --exclude-nodump, fixes #3160
do no read/archive bsdflags: borg create --nobsdflags ...
do not extract/set bsdflags: borg extract --nobsdflags ...

use cases:

- fs shows wrong / random bsdflags (bug in filesystem)
- fs does not support bsdflags anyway
- already archived bsdflags are wrong / unwanted
- borg shows any sort of unwanted effect due to get_flags, esp. on Linux

the nodump flag ("do not backup this file") is not honoured any more by
default because this functionality (esp. if it happened by error or
unexpected) was rather confusing and unexplainable at first to users.

if you want that "do not backup NODUMP-flagged files" behaviour, use:
borg create --exclude-nodump ...

(cherry picked from commit 10adadf685)
2017-10-17 19:36:49 +02:00
Thomas Waldmann
386e4cee59 cache: use SaveFile for more safety, fixes #3158
Looks like under unfortunate circumstances, these files could become
0 byte files (see #3158). SaveFile usage should prevent that.

(cherry picked from commit 0190abff81)
2017-10-15 01:26:17 +02:00
Thomas Waldmann
9a6da1d65e borg recreate: correctly compute part file sizes, fixes #3157
when doing in-file checkpointing, borg creates *.borg_part_N files.
complete_file = part_1 + part_2 + ... + part_N

the source item for recreate already has a precomputed (total) size
member, thus we must force recomputation from the (partial) chunks
list to correct the size to be the part's size only.

borg create avoided this problem by computing the size member after
writing all the parts. this is now not required any more.

the bug is mostly cosmetic, borg check will complain, borg extract on
a part file would also complain. but all the complaints only refer to
the wrong metadata of the part files, the part files' contents are
correct.

usually you will never extract or look at part files, but only deal
with the full file, which will be completely valid, all metadata and
content.

you can get rid of the archives with these cosmetic errors by running
borg recreate on them with a fixed borg version. the old part files
will get dropped (because they are usually ignored) and any new part
file created due to checkpointing will be correct.

(cherry picked from commit 9d6b125e98)
2017-10-14 19:59:38 +02:00
TW
7a05b4c960 Merge pull request #3162 from ThomasWaldmann/dont-open-special-1.1
bsdflags support: do not open BLK/CHR/LNK files, fixes #3130
2017-10-14 04:26:37 +02:00
Thomas Waldmann
e1723ec1d9 bsdflags support: do not open BLK/CHR/LNK files, fixes #3130
opening a device file for a non-existing device can be very slow.
symlinks will make the open() call fail as it is using O_NOFOLLOW.

also: lstat -> stat(..., follow_symlinks=False) like everywhere else.
(cherry picked from commit a6ee4e9aed)
2017-10-13 23:55:00 +02:00
TW
e3cdd90729 move --no-files-cache from common to borg create options, fixes #3146
for borg prune, just use do_files=False (it only needs the chunks
cache, not the files cache).

(cherry picked from commit 19ed725a58)
2017-10-13 20:19:50 +02:00
TW
17ce2f728a Merge pull request #3155 from ThomasWaldmann/maincommand-help-1.1
maincommand help 1.1
2017-10-13 01:45:19 +02:00
Thomas Waldmann
c768999a05 don't crash if only a global option is given, show help, fixes #3142
(cherry picked from commit 3be328ed70)
2017-10-12 23:34:14 +02:00
TW
42046524e5 Merge pull request #3133 from ThomasWaldmann/fix-nonlocal-path-detection-1.1
fix detection of non-local path, fixes #3108
2017-10-11 14:10:18 +02:00
TW
9e83632c06 Merge pull request #3132 from ThomasWaldmann/no-time-end-1.1
recreate: don't crash on attic archives w/o time_end, fixes #3109
2017-10-11 14:05:32 +02:00
TW
c5b02cebc3 Merge pull request #3131 from ThomasWaldmann/support-no-hardlinks-1.1
catch ENOTSUP for os.link, fixes #3107
2017-10-11 14:05:00 +02:00
TW
8ca6dc03d2 Merge pull request #3129 from ThomasWaldmann/fallback-no-truncate-1.1
don't crash in first part of truncate_and_unlink, fixes #3117
2017-10-11 14:04:34 +02:00
TW
6f8994e4b9 Merge pull request #3134 from ThomasWaldmann/logging-config-fix-1.1
logging with fileConfig: set json attr on "borg" logger, fixes #3114
2017-10-11 14:03:22 +02:00
Marian Beermann
ad07efcb29 init: fix wrong encryption choices in command line parser
(cherry picked from commit b00179ff78)
2017-10-11 01:18:19 +02:00
Thomas Waldmann
edcc64aeed logging with fileConfig: set json attr on "borg" logger, fixes #3114
(cherry picked from commit afba813706)
2017-10-11 01:10:11 +02:00
Thomas Waldmann
d35537c199 fix detection of non-local path, fixes #3108
filenames like ..foobar are valid, so, to detect stuff in upper dirs,
we need to include the path separator and check if it starts with '../'.

(cherry picked from commit 60e9249100)
2017-10-11 01:02:28 +02:00
Thomas Waldmann
fd253a2813 recreate: don't crash on attic archives w/o time_end, fixes #3109
(cherry picked from commit 9d3daebd5f)
2017-10-11 00:56:46 +02:00
Thomas Waldmann
747cfadf79 catch ENOTSUP for os.link, fixes #3107
(cherry picked from commit 203a5c8f19)
2017-10-11 00:34:05 +02:00
Thomas Waldmann
a68d463041 don't crash in first part of truncate_and_unlink, fixes #3117
(cherry picked from commit 7a689b1295)
2017-10-11 00:16:51 +02:00
Thomas Waldmann
5e3758fc7a auto compression: make sure expensive compression is actually better
if it is not significantly better compressed, we just store lz4
compressed data (which we already have computed anyway), because
that at least decompressed super fast.

(cherry picked from commit 011e0fd3fa)
2017-10-07 16:21:09 +02:00
Thomas Waldmann
7e4d6cac0f fix LDLP restoration for subprocesses, fixes #3077
(cherry picked from commit b5069770b7)
2017-10-01 20:58:18 +02:00
Thomas Waldmann
eab9f5a07b implement files cache mode control, fixes #911
You can now control the files cache mode using this option:

--files-cache={ctime,mtime,size,inode,rechunk,disabled}*

(only some combinations are supported)

Previously, only these modes were supported:
- mtime,size,inode (default of borg < 1.1.0rc4)
- mtime,size (by using --ignore-inode)
- disabled (by using --no-files-cache)

Now, you additionally get:
- ctime alternatively to mtime (more safe), e.g.:
  ctime,size,inode (this is the new default of borg >= 1.1.0rc4)
- rechunk (consider all files as changed, rechunk them)

Deprecated:
- --ignore-inodes (use modes without "inode")
- --no-files-cache (use "disabled" mode)

The tests needed some changes:
- previously, we use os.utime() to set a files mtime (atime) to specific
  values, but that does not work for ctime.
- now use time.sleep() to create the "latest file" that usually does
  not end up in the files cache (see FAQ)

(cherry picked from commit 5e2de8ba67)
2017-10-01 01:27:18 +02:00
Thomas Waldmann
f2b48cd5c8 remote: deal with partial lines, fixes #2637
due to block buffering (in borg, pipes, sshd, ssh) partial lines might
be received. for plain text, this causes cosmetic issues, for json it
causes tracebacks due to parse errors.

the code now makes sure handle_remote_line() only gets called with a
complete line (which is terminated by any universal newline char, a
pure \r seems to be needed for remote progress displays).

it also fixes a yet undiscovered partial utf-8-sequence decoding issue
that might occur for the same reason.

(cherry picked from commit 8646216a06)
2017-09-26 22:06:13 +02:00
Thomas Waldmann
37a5442bef use prepared env for xattr module's fakeroot version check
(cherry picked from commit a57e23fdb3)
2017-09-25 05:54:50 +02:00
Thomas Waldmann
d7a5ca2e6a use prepared env for borg export-tar --tar-filter subprocess
(cherry picked from commit cf59f653e5)
2017-09-25 05:54:30 +02:00
Thomas Waldmann
d6f810560c use prepared env for borg umount
(cherry picked from commit b88da10641)
2017-09-25 05:53:56 +02:00
Thomas Waldmann
3b20c18c3b use prepared env for borg with-lock
(cherry picked from commit 6da5bf4b85)
2017-09-25 05:51:53 +02:00
Thomas Waldmann
2f7d7bdbb8 use prepared env for calling BORG_PASSCOMMAND, fixes #3050
(cherry picked from commit 6a6fd31804)
2017-09-25 05:51:02 +02:00
Thomas Waldmann
5dd16672c0 refactor/fix subprocess env preparation
refactor: make a generally usable function

fix: remove support code for ancient pyinstaller

the "else" branch was needed for pyinstaller < 20160820 because it did
not have the LD_LIBRARY_PATH_ORIG env var, so we just killed LDLP
because we had no better way.

but with borg tests running under fakeroot, this is troublesome as
fakeroot uses this also and can't find its library without it.

so, just remove it, we do not need to support old pyinstaller.

(cherry picked from commit ba941b0801)
2017-09-25 05:50:19 +02:00
Thomas Waldmann
f48f86444d remove client_supports_log_v3 flag, fixes #3033
the client_supports_log_v3 flag was added to differentiate 1.1.0 beta3
to beta5 clients (which did not support parsing json log format from
server) from >= 1.1.0beta6 clients (which support it).
for clients older than 1.1.0b3, no json log format will be negotiated
anyway.

by removing the client_supports_log_v3 flag support, we drop support for
clients using 1.1.0beta3..5.

thus, a client is now expected to either support old log format (like
borg 1.0.x) or new json format (like borg 1.1.0 >= beta6).

client     server comment
===========================================
any        0.29+  uses $LOG plain remote log format
any        1.0.x  uses $LOG plain remote log format
1.0.x      1.1.0  uses $LOG plain remote log format
1.1.0b1/b2 1.1.0  (uses $LOG plain remote log format)
1.1.0b3-b5 1.1.0  (malfunction)
1.1.0b6    1.1.0  (uses json remote log format)
1.1.0rc    1.1.0  uses json remote log format
1.1.x      1.1.0  uses json remote log format

(beta testing is over and betas are unsupported now)

Note: client_supports_log_v3 flag was added in changeset
      18a2902c9c

(cherry picked from commit 54c5049fb9)
2017-09-25 02:41:15 +02:00
Thomas Waldmann
b6abee4d68 docs: change-passphrase only changes the passphrase, fixes #2990
(cherry picked from commit 713be765d1)
2017-09-23 21:30:18 +02:00
Thomas Waldmann
f44fd6ba19 flush json mode progress stderr output
if borg stderr is not connected to a tty, but to ssh (when using
borg client/server), sys.stderr is block buffered (tty: line buffered).

thus we better flush explicitly after emitting a line as the receiving
side can not handle partial json at the end of the block.

also, it might solve some delays, when output didn't arrive at
receiving side in time.

(cherry picked from commit 2b75b278da)
2017-09-21 19:18:40 +02:00
enkore
ecc5ceec07 delete: support naming multiple archives (#3017)
(cherry picked from commit 7c5a9d89b2)
2017-09-09 23:28:47 +02:00
TW
319606e1cf Merge pull request #3008 from ThomasWaldmann/fix-2994-1.1
fix .isoformat() issues (1.1-maint)
2017-09-07 16:00:59 +02:00
TW
af407e3e7f Merge pull request #3007 from ThomasWaldmann/fd-cache-invalidation-1.1
FD cache invalidation (1.1-maint)
2017-09-07 15:56:26 +02:00
Thomas Waldmann
da2f8dbe81 get rid of datetime.isoformat to avoid bugs like #2994
(cherry picked from commit 928bde8676)
2017-09-07 15:11:53 +02:00
Thomas Waldmann
a9aa3c5f34 use safe parse_timestamp to parse timestamps, fixes #2994
also: refactor so it is possible to get tz-unaware datetime
objects from parse_timestamp.

(cherry picked from commit 7996a87357)
2017-09-07 15:06:23 +02:00
Thomas Waldmann
457f5ceb30 use ISO_FORMAT* constants
(cherry picked from commit eebb117349)
2017-09-07 15:02:29 +02:00
Thomas Waldmann
764324304d move ISO_FORMAT to constants module
also: add ISO_FORMAT_NO_USECS
(cherry picked from commit 1cb158a4b5)
2017-09-07 14:56:27 +02:00
Thomas Waldmann
88e1340445 repo cleanup/write: invalidate cached FDs
(cherry picked from commit 7122913825)
2017-09-07 14:31:07 +02:00
Thomas Waldmann
2a58fe4266 repo: add test case for uncommitted garbage segment files
(cherry picked from commit 4a4c8884ee)
2017-09-07 14:29:37 +02:00
Thomas Waldmann
eeaa43b668 with-lock: close segment file before invoking subprocess
(cherry picked from commit b9dce0ebdc)
2017-09-07 14:25:22 +02:00
TW
93cedbb761 Merge pull request #2993 from ThomasWaldmann/issue/2975-1.1
test_detect_attic_repo: don't test mount
2017-09-02 19:17:29 +02:00
TW
c77dd42302 Merge pull request #2992 from ThomasWaldmann/cleanup-log-1.1
add debug logging for repository cleanup
2017-09-02 18:52:05 +02:00