diff --git a/docs/changes.rst b/docs/changes.rst index 548446b06e..705877a86b 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -217,8 +217,8 @@ The best check that everything is ok is to run a dry-run extraction:: Changelog ========= -Version 1.1.15 (not released yet) ---------------------------------- +Version 1.1.15 (2020-12-25) +--------------------------- Compatibility notes: @@ -247,13 +247,19 @@ Compatibility notes: Fixes: -- use --timestamp for {utcnow} and {now} if given, #5189 -- create: fix --dry-run and --stats coexistence, #5415 +- extract: + + - improve exception handling when setting xattrs, #5092. + - emit a warning message giving the path, xattr key and error message. + - continue trying to restore other xattrs and bsdflags of the same file + after an exception with xattr-setting happened. - export-tar: - set tar format to GNU_FORMAT explicitly, #5274 - fix memory leak with ssh: remote repository, #5568 - fix potential memory leak with ssh: remote repository with partial extraction +- create: fix --dry-run and --stats coexistence, #5415 +- use --timestamp for {utcnow} and {now} if given, #5189 New features: @@ -268,6 +274,7 @@ Other changes: - set cython language_level in some files to fix warnings - allow EIO with warning when trying to hardlink - PropDict: fail early if internal_dict is not a dict +- update shell completions - tests / CI - add a test for the hashindex corruption bug, #5531 #4829 @@ -293,6 +300,7 @@ Other changes: - new compression algorithm policy, #1633 #5505 - faq: add a hint on sleeping computer, #5301 - note requirements for full disk access on macOS Catalina, #5303 + - fix/improve description of borg upgrade hardlink usage, #5518 - modernize 1.1 code: - drop code/workarounds only needed to support Python 3.4 diff --git a/docs/man/borg-benchmark-crud.1 b/docs/man/borg-benchmark-crud.1 index ec730625b4..4b6f5fd5cd 100644 --- a/docs/man/borg-benchmark-crud.1 +++ b/docs/man/borg-benchmark-crud.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-BENCHMARK-CRUD 1 "2020-10-06" "" "borg backup tool" +.TH BORG-BENCHMARK-CRUD 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-benchmark-crud \- Benchmark Create, Read, Update, Delete for archives. . diff --git a/docs/man/borg-benchmark.1 b/docs/man/borg-benchmark.1 index 74282976df..a0e33472ed 100644 --- a/docs/man/borg-benchmark.1 +++ b/docs/man/borg-benchmark.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-BENCHMARK 1 "2020-10-06" "" "borg backup tool" +.TH BORG-BENCHMARK 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-benchmark \- benchmark command . diff --git a/docs/man/borg-break-lock.1 b/docs/man/borg-break-lock.1 index eb434e9d8b..284124ae22 100644 --- a/docs/man/borg-break-lock.1 +++ b/docs/man/borg-break-lock.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-BREAK-LOCK 1 "2020-10-06" "" "borg backup tool" +.TH BORG-BREAK-LOCK 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-break-lock \- Break the repository lock (e.g. in case it was left by a dead borg. . diff --git a/docs/man/borg-change-passphrase.1 b/docs/man/borg-change-passphrase.1 index 5869d244fb..bd627f95b8 100644 --- a/docs/man/borg-change-passphrase.1 +++ b/docs/man/borg-change-passphrase.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-CHANGE-PASSPHRASE 1 "2020-10-06" "" "borg backup tool" +.TH BORG-CHANGE-PASSPHRASE 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-change-passphrase \- Change repository key file passphrase . diff --git a/docs/man/borg-check.1 b/docs/man/borg-check.1 index bb8c606e15..8335b45097 100644 --- a/docs/man/borg-check.1 +++ b/docs/man/borg-check.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-CHECK 1 "2020-10-06" "" "borg backup tool" +.TH BORG-CHECK 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-check \- Check repository consistency . diff --git a/docs/man/borg-common.1 b/docs/man/borg-common.1 index d6dce89dec..7f3f8d0950 100644 --- a/docs/man/borg-common.1 +++ b/docs/man/borg-common.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-COMMON 1 "2020-10-06" "" "borg backup tool" +.TH BORG-COMMON 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-common \- Common options of Borg commands . diff --git a/docs/man/borg-compression.1 b/docs/man/borg-compression.1 index 5390fbc012..142a5b69f3 100644 --- a/docs/man/borg-compression.1 +++ b/docs/man/borg-compression.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-COMPRESSION 1 "2020-10-06" "" "borg backup tool" +.TH BORG-COMPRESSION 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-compression \- Details regarding compression . diff --git a/docs/man/borg-config.1 b/docs/man/borg-config.1 index d1d5a112a0..f78a2bde66 100644 --- a/docs/man/borg-config.1 +++ b/docs/man/borg-config.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-CONFIG 1 "2020-10-06" "" "borg backup tool" +.TH BORG-CONFIG 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-config \- get, set, and delete values in a repository or cache config file . diff --git a/docs/man/borg-create.1 b/docs/man/borg-create.1 index a2ed3ad302..89ebb32ec6 100644 --- a/docs/man/borg-create.1 +++ b/docs/man/borg-create.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-CREATE 1 "2020-10-06" "" "borg backup tool" +.TH BORG-CREATE 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-create \- Create new archive . @@ -117,6 +117,7 @@ the state after creation. Also, the \fB\-\-stats\fP and \fB\-\-dry\-run\fP optio exclusive because the data is not actually compressed and deduplicated during a dry run. .sp See the output of the "borg help patterns" command for more help on exclude patterns. +.sp See the output of the "borg help placeholders" command for more help on placeholders. .SH OPTIONS .sp @@ -156,6 +157,15 @@ do not load/update the file metadata cache used to detect unchanged files .TP .BI \-\-stdin\-name \ NAME use NAME in archive for stdin data (default: "stdin") +.TP +.BI \-\-stdin\-user \ USER +set user USER in archive for stdin data (default: \(aqroot\(aq) +.TP +.BI \-\-stdin\-group \ GROUP +set group GROUP in archive for stdin data (default: \(aqroot\(aq) +.TP +.BI \-\-stdin\-mode \ M +set mode to M in archive for stdin data (default: 0660) .UNINDENT .SS Exclusion options .INDENT 0.0 @@ -188,7 +198,7 @@ exclude files flagged NODUMP .INDENT 0.0 .TP .B \-x\fP,\fB \-\-one\-file\-system -stay in the same file system and do not store mount points of other file systems +stay in the same file system and do not store mount points of other file systems. This might behave different from your expectations, see the docs. .TP .B \-\-numeric\-owner only store numeric user and group identifiers @@ -320,6 +330,17 @@ all of its contents will be omitted from the backup. If, however, you wish to only include the objects specified by \fB\-\-exclude\-if\-present\fP in your backup, and not include any other contents of the containing folder, this can be enabled through using the \fB\-\-keep\-exclude\-tags\fP option. +.sp +The \fB\-x\fP or \fB\-\-one\-file\-system\fP option excludes directories, that are mountpoints (and everything in them). +It detects mountpoints by comparing the device number from the output of \fBstat()\fP of the directory and its +parent directory. Specifically, it excludes directories for which \fBstat()\fP reports a device number different +from the device number of their parent. Be aware that in Linux (and possibly elsewhere) there are directories +with device number different from their parent, which the kernel does not consider a mountpoint and also the +other way around. Examples are bind mounts (possibly same device number, but always a mountpoint) and ALL +subvolumes of a btrfs (different device number from parent but not necessarily a mountpoint). Therefore when +using \fB\-\-one\-file\-system\fP, one should make doubly sure that the backup works as intended especially when using +btrfs. This is even more important, if the btrfs layout was created by someone else, e.g. a distribution +installer. .SS Item flags .sp \fB\-\-list\fP outputs a list of all files, directories and other diff --git a/docs/man/borg-delete.1 b/docs/man/borg-delete.1 index 760185a26b..fbc23bd8f6 100644 --- a/docs/man/borg-delete.1 +++ b/docs/man/borg-delete.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-DELETE 1 "2020-10-06" "" "borg backup tool" +.TH BORG-DELETE 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-delete \- Delete an existing repository or archives . diff --git a/docs/man/borg-diff.1 b/docs/man/borg-diff.1 index ba7e0efa75..26bd979d1b 100644 --- a/docs/man/borg-diff.1 +++ b/docs/man/borg-diff.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-DIFF 1 "2020-10-06" "" "borg backup tool" +.TH BORG-DIFF 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-diff \- Diff contents of two archives . diff --git a/docs/man/borg-export-tar.1 b/docs/man/borg-export-tar.1 index e05e1719cd..75580b0209 100644 --- a/docs/man/borg-export-tar.1 +++ b/docs/man/borg-export-tar.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-EXPORT-TAR 1 "2020-10-06" "" "borg backup tool" +.TH BORG-EXPORT-TAR 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-export-tar \- Export archive contents as a tarball . diff --git a/docs/man/borg-extract.1 b/docs/man/borg-extract.1 index b7f09b7d96..7dbd3b801e 100644 --- a/docs/man/borg-extract.1 +++ b/docs/man/borg-extract.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-EXTRACT 1 "2020-10-06" "" "borg backup tool" +.TH BORG-EXTRACT 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-extract \- Extract archive contents . diff --git a/docs/man/borg-info.1 b/docs/man/borg-info.1 index 0a0a8fda54..9bf3f8ed1d 100644 --- a/docs/man/borg-info.1 +++ b/docs/man/borg-info.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-INFO 1 "2020-10-06" "" "borg backup tool" +.TH BORG-INFO 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-info \- Show archive details such as disk space used . diff --git a/docs/man/borg-init.1 b/docs/man/borg-init.1 index 1b397ada43..b1b94ff35a 100644 --- a/docs/man/borg-init.1 +++ b/docs/man/borg-init.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-INIT 1 "2020-10-06" "" "borg backup tool" +.TH BORG-INIT 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-init \- Initialize an empty repository . diff --git a/docs/man/borg-key-change-passphrase.1 b/docs/man/borg-key-change-passphrase.1 index 1df0ea18db..6df13dd94a 100644 --- a/docs/man/borg-key-change-passphrase.1 +++ b/docs/man/borg-key-change-passphrase.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-KEY-CHANGE-PASSPHRASE 1 "2020-10-06" "" "borg backup tool" +.TH BORG-KEY-CHANGE-PASSPHRASE 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-key-change-passphrase \- Change repository key file passphrase . diff --git a/docs/man/borg-key-export.1 b/docs/man/borg-key-export.1 index f57d590aad..ae4e48ad43 100644 --- a/docs/man/borg-key-export.1 +++ b/docs/man/borg-key-export.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-KEY-EXPORT 1 "2020-10-06" "" "borg backup tool" +.TH BORG-KEY-EXPORT 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-key-export \- Export the repository key for backup . diff --git a/docs/man/borg-key-import.1 b/docs/man/borg-key-import.1 index 280500944c..29f1639564 100644 --- a/docs/man/borg-key-import.1 +++ b/docs/man/borg-key-import.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-KEY-IMPORT 1 "2020-10-06" "" "borg backup tool" +.TH BORG-KEY-IMPORT 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-key-import \- Import the repository key from backup . diff --git a/docs/man/borg-key-migrate-to-repokey.1 b/docs/man/borg-key-migrate-to-repokey.1 index f8a52c2dc3..23345fe1bb 100644 --- a/docs/man/borg-key-migrate-to-repokey.1 +++ b/docs/man/borg-key-migrate-to-repokey.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-KEY-MIGRATE-TO-REPOKEY 1 "2020-10-06" "" "borg backup tool" +.TH BORG-KEY-MIGRATE-TO-REPOKEY 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-key-migrate-to-repokey \- Migrate passphrase -> repokey . diff --git a/docs/man/borg-key.1 b/docs/man/borg-key.1 index b43623147f..c4e3a188b9 100644 --- a/docs/man/borg-key.1 +++ b/docs/man/borg-key.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-KEY 1 "2020-10-06" "" "borg backup tool" +.TH BORG-KEY 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-key \- Manage a keyfile or repokey of a repository . diff --git a/docs/man/borg-list.1 b/docs/man/borg-list.1 index 3921df7a07..18345726d1 100644 --- a/docs/man/borg-list.1 +++ b/docs/man/borg-list.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-LIST 1 "2020-10-06" "" "borg backup tool" +.TH BORG-LIST 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-list \- List archive or repository contents . @@ -119,6 +119,13 @@ lrwxrwxrwx root root 0 Fri, 2015\-03\-27 20:24:26 bin/bzcmp \-> bzdif \-rwxr\-xr\-x root root 2140 Fri, 2015\-03\-27 20:24:22 bin/bzdiff \&... +$ borg list /path/to/repo::root\-2016\-02\-15 \-\-pattern "\- bin/ba*" +drwxr\-xr\-x root root 0 Mon, 2016\-02\-15 17:44:27 . +drwxrwxr\-x root root 0 Mon, 2016\-02\-15 19:04:49 bin +lrwxrwxrwx root root 0 Fri, 2015\-03\-27 20:24:26 bin/bzcmp \-> bzdiff +\-rwxr\-xr\-x root root 2140 Fri, 2015\-03\-27 20:24:22 bin/bzdiff +\&... + $ borg list /path/to/repo::archiveA \-\-format="{mode} {user:6} {group:6} {size:8d} {isomtime} {path}{extra}{NEWLINE}" drwxrwxr\-x user user 0 Sun, 2015\-02\-01 11:00:00 . drwxrwxr\-x user user 0 Sun, 2015\-02\-01 11:00:00 code diff --git a/docs/man/borg-mount.1 b/docs/man/borg-mount.1 index f99c7979c3..ec25fd5ab1 100644 --- a/docs/man/borg-mount.1 +++ b/docs/man/borg-mount.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-MOUNT 1 "2020-10-06" "" "borg backup tool" +.TH BORG-MOUNT 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-mount \- Mount archive or an entire repository as a FUSE filesystem . diff --git a/docs/man/borg-patterns.1 b/docs/man/borg-patterns.1 index 855f19090c..50db54011a 100644 --- a/docs/man/borg-patterns.1 +++ b/docs/man/borg-patterns.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BORG-PATTERNS 1 "2020-10-06" "" "borg backup tool" +.TH BORG-PATTERNS 1 "2020-12-24" "" "borg backup tool" .SH NAME borg-patterns \- Details regarding patterns . @@ -168,8 +168,10 @@ $ cat >exclude.txt <`_, e.g. {now:%Y-%m-%d_%H:%M:%S} + You can also supply your own `format string `_, e.g. {now:%Y-%m-%d_%H:%M:%S} {utcnow} The current UTC date and time, by default in ISO-8601 format. - You can also supply your own `format string `_, e.g. {utcnow:%Y-%m-%d_%H:%M:%S} + You can also supply your own `format string `_, e.g. {utcnow:%Y-%m-%d_%H:%M:%S} {user} The user name (or UID, if no name is available) of the user running borg. diff --git a/src/borg/archive.py b/src/borg/archive.py index 9ae4358b9e..612f7cab09 100644 --- a/src/borg/archive.py +++ b/src/borg/archive.py @@ -784,7 +784,7 @@ def restore_attrs(self, path, item, symlink=False, fd=None): # generic handler # EACCES: permission denied to set this specific xattr (this may happen related to security.* keys) # EPERM: operation not permitted - err_str = str(e) + err_str = os.strerror(e.errno) logger.warning(msg_format % err_str) set_ec(EXIT_WARNING) # bsdflags include the immutable flag and need to be set last: diff --git a/src/borg/testsuite/archiver.py b/src/borg/testsuite/archiver.py index b5f8eeb664..8033707faa 100644 --- a/src/borg/testsuite/archiver.py +++ b/src/borg/testsuite/archiver.py @@ -1309,16 +1309,15 @@ def patched_setxattr_EACCES(*args, **kwargs): input_abspath = os.path.abspath('input/file') with patch.object(xattr, 'setxattr', patched_setxattr_E2BIG): out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING) - assert out == (input_abspath + ': Value or key of extended attribute user.attribute is too big for this ' - 'filesystem\n') + assert out == (input_abspath + ': when setting extended attribute user.attribute: too big for this filesystem\n') os.remove(input_abspath) with patch.object(xattr, 'setxattr', patched_setxattr_ENOTSUP): out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING) - assert out == (input_abspath + ': Extended attributes are not supported on this filesystem\n') + assert out == (input_abspath + ': when setting extended attribute user.attribute: xattrs not supported on this filesystem\n') os.remove(input_abspath) with patch.object(xattr, 'setxattr', patched_setxattr_EACCES): out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING) - assert out == (input_abspath + ': Permission denied when setting extended attribute user.attribute\n') + assert out == (input_abspath + ': when setting extended attribute user.attribute: Permission denied\n') assert os.path.isfile(input_abspath) def test_path_normalization(self):