Commit graph

898 commits

Author SHA1 Message Date
Thomas Waldmann
49c4cbb93c stats: do not count data volume twice when checkpointing, fixes #3224
(cherry picked from commit 66cd1cd240)
2017-11-05 00:52:20 +01:00
Thomas Waldmann
095a0b61da borg list: remove tag-file options, fixes #3226
they are not used for borg list.

(cherry picked from commit 702afa9e48)
2017-11-04 21:46:14 +01:00
TW
5680de537c
Merge pull request #3273 from ThomasWaldmann/set-bsdflags-last-1.1
set bsdflags last (include immutable flag), fixes #3263
2017-11-04 21:40:42 +01:00
Thomas Waldmann
28a25b354b recreate: move chunks_healthy when excluding hardlink master, fixes #3228
(cherry picked from commit 7aafcc517a)
2017-11-04 18:52:29 +01:00
Thomas Waldmann
b078991157 get rid of already existing invalid chunks_healthy metadata, see #3218
(cherry picked from commit 90186ad12b)
2017-11-04 18:52:13 +01:00
Thomas Waldmann
fe74b54890 get rid of chunks_healthy when rechunking, fixes #3218
(cherry picked from commit 7211bb2211)
2017-11-04 18:51:46 +01:00
Thomas Waldmann
5d71ae2f66 set bsdflags last (include immutable flag), fixes #3263
(cherry picked from commit 2c6f9634bc)
2017-11-04 18:30:16 +01:00
TW
b4267ba4a7
Merge pull request #3261 from ThomasWaldmann/stat-after-match-1.1
Stat after match (1.1-maint)
2017-11-04 14:58:10 +01:00
TW
299b9df057
Merge pull request #3247 from ThomasWaldmann/fix-old-server-hack-1.1
remove evil trailing comma, fixes #3244 (1.1)
2017-11-04 13:44:26 +01:00
Narendra Vardi
67e0fbb273 added unittest for get_config_dir function
(cherry picked from commit a3f1e6e250)
2017-11-03 18:38:21 +01:00
Narendra Vardi
60d2b9c193 add BORG_CONFIG_DIR env (#3083)
(cherry picked from commit 56fed4f964)
2017-11-03 18:37:56 +01:00
Thomas Waldmann
0943f2235e mention "!" (exclude-norecurse) type in patterns help
(cherry picked from commit 36f2a4e1dc)
2017-11-03 18:29:56 +01:00
Thomas Waldmann
338f56b97d don't do stat() when not recursing into excluded dir, fixes #3209
also: fix exception handling for the stat() calls

just moving all these lines into the "try"-block below (like it was in 1.0).

(cherry picked from commit 0c410e84fe)
2017-11-03 18:29:21 +01:00
Thomas Waldmann
a43e2c3043 remove evil trailing comma, fixes #3244
value type of compatMap is a tuple of strings.

due to the trailing comma, this was a 1-tuple of a tuple of strings.

(cherry picked from commit 117d30d171)
2017-11-02 17:34:41 +01:00
Thomas Waldmann
5ce4fa9704 arg parsing: fix fallback function, refactor, fixes #3205
This is a fixup for #3155, which was broken on at least python <= 3.4.2.

Also clarify when to use which *func in set_defaults.
2017-10-22 17:34:02 +02:00
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