Commit graph

938 commits

Author SHA1 Message Date
Thomas Waldmann
93de42bb25 show excluded dir with "x" for tagged dirs / caches, fixes #3189 2017-10-20 04:54:09 +02:00
TW
38dd1f11ac Merge pull request #3181 from ThomasWaldmann/hardlinked-symlink-warning
remove hardlinked symlink warning, update docs
2017-10-17 21:30:53 +02:00
Thomas Waldmann
10adadf685 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 ...
2017-10-17 18:45:32 +02:00
Thomas Waldmann
e674822888 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.
2017-10-17 18:34:32 +02:00
Thomas Waldmann
0190abff81 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.
2017-10-15 00:39:39 +02:00
Thomas Waldmann
9d6b125e98 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.
2017-10-14 04:24:26 +02:00
Thomas Waldmann
a6ee4e9aed 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.
2017-10-13 23:53:22 +02:00
TW
19ed725a58 move files-cache related options to borg create, fixes #3146 (#3147)
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).
2017-10-13 20:16:30 +02:00
Thomas Waldmann
3be328ed70 don't crash if only a global option is given, show help, fixes #3142 2017-10-12 05:40:52 +02:00
TW
c8bf9dba4a Merge pull request #3122 from ThomasWaldmann/logging-config-fix
logging with fileConfig: set json attr on "borg" logger, fixes #3114
2017-10-11 01:08:31 +02:00
TW
13a4439bb8 Merge pull request #3120 from ThomasWaldmann/fix-nonlocal-path-detection
fix detection of non-local path, fixes #3108
2017-10-11 01:01:17 +02:00
TW
0bddbb32b4 Merge pull request #3119 from ThomasWaldmann/no-time-end
recreate: don't crash on attic archives w/o time_end, fixes #3109
2017-10-11 00:55:22 +02:00
TW
8455ab3ff2 Merge pull request #3121 from ThomasWaldmann/support-no-hardlinks
catch ENOTSUP for os.link, fixes #3107
2017-10-11 00:32:37 +02:00
Thomas Waldmann
afba813706 logging with fileConfig: set json attr on "borg" logger, fixes #3114 2017-10-10 02:18:13 +02:00
Thomas Waldmann
203a5c8f19 catch ENOTSUP for os.link, fixes #3107 2017-10-10 01:57:58 +02:00
Thomas Waldmann
60e9249100 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 '../'.
2017-10-10 01:36:44 +02:00
Thomas Waldmann
7a689b1295 don't crash in first part of truncate_and_unlink, fixes #3117 2017-10-10 01:25:19 +02:00
Thomas Waldmann
9d3daebd5f recreate: don't crash on attic archives w/o time_end, fixes #3109 2017-10-10 01:17:56 +02:00
Marian Beermann
b00179ff78 init: fix wrong encryption choices in command line parser 2017-10-08 12:29:03 +02:00
Thomas Waldmann
011e0fd3fa 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.
2017-10-03 21:11:43 +02:00
Thomas Waldmann
b5069770b7 fix LDLP restoration for subprocesses, fixes #3077 2017-10-01 19:17:23 +02:00
Thomas Waldmann
5e2de8ba67 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)
2017-10-01 00:52:32 +02:00
TW
e8e204833c Merge pull request #3058 from ThomasWaldmann/fix-partial-json
remote: deal with partial lines, fixes #2637
2017-09-26 22:03:26 +02:00
Thomas Waldmann
a57e23fdb3 use prepared env for xattr module's fakeroot version check 2017-09-25 04:36:07 +02:00
Thomas Waldmann
cf59f653e5 use prepared env for borg export-tar --tar-filter subprocess 2017-09-25 04:36:07 +02:00
Thomas Waldmann
b88da10641 use prepared env for borg umount 2017-09-25 04:36:07 +02:00
Thomas Waldmann
6da5bf4b85 use prepared env for borg with-lock 2017-09-25 04:36:07 +02:00
Thomas Waldmann
6a6fd31804 use prepared env for calling BORG_PASSCOMMAND, fixes #3050 2017-09-25 04:36:06 +02:00
Thomas Waldmann
ba941b0801 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.
2017-09-25 04:34:58 +02:00
Thomas Waldmann
8646216a06 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.
2017-09-25 02:44:54 +02:00
TW
d719c1eb70 Merge pull request #3037 from ThomasWaldmann/remove-110b-logger
remove client_supports_log_v3 flag, fixes #3033
2017-09-25 00:50:36 +02:00
Thomas Waldmann
713be765d1 docs: change-passphrase only changes the passphrase, fixes #2990 2017-09-22 22:53:55 +02:00
Thomas Waldmann
54c5049fb9 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
2017-09-21 04:11:59 +02:00
Thomas Waldmann
2b75b278da 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.
2017-09-18 04:42:30 +02:00
enkore
7c5a9d89b2 delete: support naming multiple archives (#3017)
delete: support naming multiple archives
2017-09-09 23:08:23 +02:00
TW
67cb76809a Merge pull request #2998 from ThomasWaldmann/fix-2994
fix .isoformat() issues
2017-09-07 14:54:46 +02:00
Thomas Waldmann
928bde8676 get rid of datetime.isoformat to avoid bugs like #2994 2017-09-07 14:11:07 +02:00
enkore
2eab60ff49 Merge pull request #3001 from ThomasWaldmann/close-segment
with-lock: close segment file before invoking subprocess
2017-09-07 10:38:45 +02:00
Thomas Waldmann
7122913825 repo cleanup/write: invalidate cached FDs 2017-09-06 06:11:39 +02:00
Thomas Waldmann
4a4c8884ee repo: add test case for uncommitted garbage segment files 2017-09-06 06:11:39 +02:00
Thomas Waldmann
573733bc81 fixup: only works for local repos 2017-09-06 04:06:17 +02:00
Thomas Waldmann
b9dce0ebdc with-lock: close segment file before invoking subprocess 2017-09-06 03:49:45 +02:00
Thomas Waldmann
7996a87357 use safe parse_timestamp to parse timestamps, fixes #2994
also: refactor so it is possible to get tz-unaware datetime
objects from parse_timestamp.
2017-09-05 05:51:00 +02:00
Thomas Waldmann
eebb117349 use ISO_FORMAT* constants 2017-09-05 05:02:44 +02:00
Thomas Waldmann
1cb158a4b5 move ISO_FORMAT to constants module
also: add ISO_FORMAT_NO_USECS
2017-09-05 04:44:38 +02:00
TW
86c0b66de3 Merge pull request #2988 from ThomasWaldmann/recover-segments-memory-usage
recover_segment: use mmap(), fixes #2982
2017-09-02 17:48:04 +02:00
Thomas Waldmann
9fc4d00bf6 recover_segment: use mmap(), fixes #2982 2017-09-01 05:26:27 +02:00
Thomas Waldmann
57f808e4bb add debug logging for repository cleanup
so we can know whether it did a cleanup and if so,
which and how many segments were cleaned up.
2017-08-31 22:49:30 +02:00
TW
4a22dec340 Merge pull request #2979 from enkore/issue/2975
test_detect_attic_repo: don't test mount
2017-08-30 23:22:36 +02:00
Marian Beermann
a6be34f8f7 test_detect_attic_repo: don't test mount
since mount is not always available and if it works for all the other
commands, then it is likely it works for mount as well.
2017-08-28 10:17:52 +02:00