Axel Burri
ba3c36c984
btrbk: fix duplicate cmdline option -l in lsbtr
2025-07-06 01:09:14 +02:00
Axel Burri
c69f70e1d0
btrbk: fix loglevel along with verbose
2025-07-06 00:56:29 +02:00
Axel Burri
18ddc65979
documentation: fix stream_compress_adapt
2023-08-28 19:14:35 +02:00
Axel Burri
225f60f565
btrbk: remove handling of deprecated options before v0.23
...
After 7 years and a lot of warnings we can drop this code. Note that
most of those refer to `upgrade_to_v0.23.0.md`, which was removed in
16364e2
.
2023-08-28 18:55:47 +02:00
Axel Burri
f7e1265e7a
documentation: remove upgrade_to_v0.23.0.md from Makefile
...
Forgotten after removal in:
16364e2833
documentation: remove obsolete upgrade_to_v0.23.0.md
2023-08-28 18:42:42 +02:00
Axel Burri
a4d4dff0d1
btrbk_restore_raw.py: fix spelling
2023-08-05 20:56:39 +02:00
Axel Burri
d819f17e44
kdf_pbkdf2.py: fix spelling
2023-08-05 20:56:39 +02:00
Axel Burri
1807ad5cee
btrbk-mail: fix spelling
2023-08-05 20:56:39 +02:00
Axel Burri
b139875e2b
btrbk: fix spelling
2023-08-05 20:56:39 +02:00
Axel Burri
f6bdab143b
documentation: fix spelling
2023-08-05 20:56:39 +02:00
Axel Burri
16364e2833
documentation: remove obsolete upgrade_to_v0.23.0.md
2023-08-05 20:56:34 +02:00
Axel Burri
efa4d13111
ChangeLog: fix spelling
2023-08-05 20:56:34 +02:00
Yaroslav Halchenko
dac6350b5d
github: actions: add codespell master on push and PRs
2023-08-05 20:28:41 +02:00
oldherl
a488096869
doc: README.md: fix typo
2023-07-14 19:40:18 +02:00
Sam James
9dfee7bc32
doc: allow asciidoc again
...
This effectively reverts 0e63843195
and
173319e7e1
.
asciidoc has been revived (for a while now) and doesn't require Python 2. We
still prefer asciidoctor and fallback to asciidoc/a2x if it's not available.
Comparing the asciidoc and asciidoctor man pages, everything looks OK.
Python tends to be available more readily in distribution build environments
rather than the Ruby stack. Also, the pregenerated man pages are gone as of
f132c94c65
.
Signed-off-by: Sam James <sam@gentoo.org>
2023-07-14 18:55:05 +02:00
Axel Burri
db45f0b09c
btrbk-mail: add example to enable all rsync
2023-07-07 01:53:15 +02:00
Axel Burri
fa704c3185
btrbk-mail: add missing declare
2023-07-07 01:45:32 +02:00
Axel Burri
b63609c298
btrbk-mail: declare associative arrays
2023-06-08 00:27:16 +02:00
Axel Burri
98580418e3
btrbk: fix displaying excluded in summary
...
- fix framework
- print source excluded by archive_exclude in summary
- fix exclude list in summary
2023-04-22 16:53:13 +02:00
Axel Burri
135edabc71
btrbk: rephrase warnings on unexpected (foreign) location
2023-04-22 16:51:32 +02:00
Axel Burri
4ba944e6a5
btrbk: fix exit status for action usage
2023-04-22 16:51:32 +02:00
Axel Burri
dd7149b111
btrbk: improve error message
2023-04-22 16:51:32 +02:00
Axel Burri
ed33db523c
btrbk: add reason text to filter statements
2023-04-22 16:51:32 +02:00
Axel Burri
15a6b98a08
btrbk: print "create" action in schedule
2023-04-22 16:51:32 +02:00
Axel Burri
eff9af34bc
btrbk: fix print schedule if deletion is skipped
...
If deletion is skipped, we don't have a schedule call on the target,
which is used for --print-schedule text. Add some (rather hacky) code
to be able to also use the schedule result of the backup process.
2023-04-22 16:51:32 +02:00
Axel Burri
468ca1eae5
btrbk: tidy logging
...
Especially corrects $svol->{PRINT} where not applicable.
2023-04-22 16:51:32 +02:00
Axel Burri
cca200707d
btrbk: set subvolume url to /dev/null on archive
...
This should not be printed anywhere. If it is, it's a bug.
2023-04-22 16:51:32 +02:00
Axel Burri
d4ab986245
btrbk: skip subvolume init on archive
2023-04-22 16:51:32 +02:00
Axel Burri
6f1145c279
btrbk: add archive related summary
...
Note that "no target action" for archive is replaced by "<no_action>",
for consistency with action run:
[-] /path/to/target/snapshot_basename.*
is now displayed as:
<no_action>
2023-04-22 16:51:32 +02:00
Axel Burri
6d047cbaec
btrbk: disable target_create_dir for user; fix dryrun
2023-04-22 16:51:32 +02:00
Axel Burri
e737927bd9
btrbk: tidy variable names
2023-04-22 16:51:32 +02:00
Axel Burri
053cd7a59c
btrbk: use parser function for assembling archive config
2023-04-22 16:51:32 +02:00
Axel Burri
443cb1891b
btrbk: action_archive: no strict_related parent search
...
strict_related parent search does not make much sense on archive: on
targets, parent_uuid chain is broken after first prune.
Ref: 318126b831
2023-04-22 16:51:32 +02:00
Axel Burri
ac0f7e3b91
btrbk: action_archive: honor archive_exclude_older in backup step
2023-04-22 16:51:32 +02:00
Axel Burri
d12241fcfc
btrbk: action_archive: use correct config_preserve_hash
2023-04-22 16:51:32 +02:00
Axel Burri
1465a1ecc2
btrbk: use same code for backup and archive
...
Note that some functionality breaks with this commit. Specific
adaptions are done in following commits.
2023-04-22 16:51:32 +02:00
Axel Burri
c385b0b731
btrbk: create dir if target_create_dir is set
2023-04-22 16:51:32 +02:00
Axel Burri
7aece45dbf
btrbk: add vinfo_mkdir
2023-04-22 16:51:32 +02:00
Axel Burri
2bdd5eb8fc
btrbk: use vinfo_realpath
2023-04-22 16:51:32 +02:00
Axel Burri
30b22d49d2
btrbk: add vinfo_realpath
2023-04-22 16:51:32 +02:00
Axel Burri
544d95e094
btrbk: add comment
2023-04-22 16:51:32 +02:00
Axel Burri
fe137bd19c
btrbk: honor --exclude on delete
2023-04-22 16:51:32 +02:00
Axel Burri
6d57aa4dbe
documentation: honor --exclude on backup candidates
2023-04-22 16:51:32 +02:00
Axel Burri
4c174c8f72
btrbk: honor --exclude on backup candidates
2023-04-22 16:51:32 +02:00
Axel Burri
c0da910276
btrbk: on resume, abort on unexpected if receive target is not present
...
A more sophisticated implementation would be to check this after
scheduling, only if the target really needs to be backuped.
We could as well automatically trigger a `btrfs snapshot -r` on target
in these cases, but this seems counter-intuitive.
2023-04-22 16:51:32 +02:00
Axel Burri
d498dbb5c3
btrbk: list unexpected archive targets when aborting
2023-04-22 16:51:32 +02:00
Axel Burri
61691abbfc
documentation: update deletion of raw targets
2023-04-22 16:51:32 +02:00
Axel Burri
c4bf7b0c5a
btrbk: use depends callback for raw depends
2023-04-22 16:51:32 +02:00
Axel Burri
6373e32875
btrbk: add depends callback to scheduler
2023-04-22 16:51:32 +02:00
Axel Burri
2a1a42e824
btrbk: related_nodes: add fatal option
2023-04-22 16:51:32 +02:00
Axel Burri
e93952b08b
btrbk: related_nodes: return reference instead of array
...
Preparatory for adding fatal option returning undef.
2023-04-22 16:51:32 +02:00
Axel Burri
131e75376f
btrbk: fix raw parent_uuid
2023-04-22 16:51:32 +02:00
Axel Burri
b77abb3eff
btrbk: abort if cmdline specified config not found
2023-04-22 16:51:32 +02:00
Axel Burri
799d235218
btrbk: remove double-slash from file arguments
...
Sanitize file (or subvolume path) arguments in safe_cmd, effectively
removing leading double slash.
Files originating from "volume /" can be assembled as "//some/subvol",
which is useful internally but undesired as command arguments, as
ancient systems might interpret leading double slash "//" in a special
way.
Posix states:
> A pathname that begins with two successive slashes may be
> interpreted in an implementation-defined manner, although more than
> two leading slashes shall be treated as a single slash.
2023-04-22 16:51:32 +02:00
Axel Burri
b9c5e3fc29
btrbk: bump version to 0.33.0-dev
2023-04-22 16:51:32 +02:00
Axel Burri
73c5d180f6
documentation: rephrase lockfile
2023-04-22 16:51:32 +02:00
Axel Burri
ac42b29b0a
bump copyright year
2023-04-10 16:04:27 +02:00
Axel Burri
5e44bc6a3e
change version to 0.32.6; update Changelog
2023-03-25 17:19:14 +01:00
Christoph Anton Mitterer
7adb32c7e9
ssh_filter_btrbk.sh: further harden the shell execution environment
...
• In principle the special `IFS`-variable could be set to some unexpected non-
standard value.
Unsetting it causes its default to be used.
• Locales and in particular their characters sets are quite complex in POSIX and
may have many subtle implications.
For example, the pattern matching notation (used in `case`-compound-commands
or some forms of parameter expansion) are in principle only defined for
character strings. While some shells handle it gracefully, the behaviour is
undefined if, for example, the character set is UTF-8 and a variable contains
bytes that do not form valid caracters in that.
Actually, there are quite some more implications.
Also, pathnames, in POSIX, are strings of bytes excluding 0x0.
For these reasons, the locale is set to the `C`/`POSIX`-locale.
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
2023-03-25 16:02:04 +01:00
Christoph Anton Mitterer
5b8c1f8f7a
ssh_filter_btrbk.sh: minor improvements
...
• Set shell options in one command.
• Homogeneously use local variables for function positional parameters in all
places.
• In redirections, omit `1` for standard output.
• Homogeneously use `if`-compount-commands instead of `[ … ] && …` in all
places.
• Homogeneously use curly brackets with parameter expansion.
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
2023-03-25 16:02:04 +01:00
Christoph Anton Mitterer
b274bd1d50
ssh_filter_btrbk.sh: replace OpenSSH’s deprecated SSH_CLIENT
...
OpenSSH’s environment variable `SSH_CLIENT` has been deprecated in upstream
commit f37e246f858cdd79be4f4e158b7b04778d1cb7e9 (2002-09-19) and replaced by
`SSH_CONNECTION`.
Both contain more than just the remote information, thus adapted the log message
to reflect that.
Since this might be used by 3rd-party programs (like fail2ban), added a specific
note to the changelog.
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
2023-03-25 16:02:04 +01:00
Christoph Anton Mitterer
ee5a543e0b
ssh_filter_btrbk.sh: use printf instead of echo
...
In spirit, POSIX considers `echo` rather obsolete (it was just kept because of
its widespread use).
It’s also not possible to use `echo` portably unless it’s `-n`-option (as the
first argument) and escape sequences are omitted.
While neither was the case here, it’s better style to just always use `printf`
in order to avoid any future confusion when both are used.
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
2023-03-25 16:02:04 +01:00
Christoph Anton Mitterer
ddc9b810de
ssh_filter_btrbk.sh: convert to POSIX sh
...
This commit finishes the work from the previous one and converts
ssh_filter_btrbk.sh to (mostly) pure POSIX Shell Command Language.
Instead of bash’s `=~`-operator for its `[[ … ]]`-compound-command it uses
`grep`.
At the time of writing, bash has at least the `nocasematch`-shell-option which
would have a negatve security impact for this program. While it’s not enabled
per default single users could potentially change that, not realising the
consequences.
Thus, moving away from this may also provide some hardening.
Unlike bash’s `=~`-operator, which matches against the whole string at once,
`grep` matches the pattern against each line of input.
This would allow for attacks by including a newline in the SSH command like in:
SSH_ORIGINAL_COMMAND="readlink /dev/stdout
cat /etc/shadow"
but is prevented by the general exclusion of newlines in commit TODO.
`grep` may return an exit status of `0` when used with its `-q`-option, even
when an error occurred.
Since this program is intended specifically for security purposes this shall be
avoided, even if such case is unlikely, and therefore its standard output and
standard error are redirected to `/dev/null` instead.
Further, using just:
local formatted_restrict_path_list="$(printf '%s' "$restrict_path_list" | sed 's/|/", "/g')"
rather than:
local formatted_restrict_path_list=""; formatted_restrict_path_list="$(printf '%s' "$restrict_path_list" | sed 's/|/", "/g')"
prevent `set -e` to take effect if the pipeline within the command substitution
fails, as the returned exit status of the whole command is the result of
`local`, not that of the assignment.
This is however no security problem here, as `formatted_restrict_path_list` is
only used for informative pruposes.
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
2023-03-25 16:02:04 +01:00
Christoph Anton Mitterer
ac1fd38beb
ssh_filter_btrbk.sh: remove unnecessary bashishms
...
ssh_filter_btrbk.sh is mainly intended for security purposes and should
therefore itself be written with that in mind.
It is written for bash, which greatly extends the POSIX Shell Command Language
and is incompatible with it in some niche cases.
For several reasons, it seems a good idea to convert the program to (mostly)
pure POSIX Shell Command Language:
• People may try to use the program with other shells (for example when bash is
not available) and make errors.
More pure `sh` implementations like dash …
• … have far less code and also less dependencies, which possibly also reduces
the chance for bugs or exploits,
• … are less dynamic in development (and have thus possibly a lower chance of
incompatible changes) …
• … and may run faster.
This commit replaces any unnecessary “bashishms” with purely POSIX compatible
code, with the exception of the `local`-built-in, which is however supported by
most POSIX compatible shells (including dash, klibc-utils’s `sh` and BusyBox’
`sh`) in some way.
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
2023-03-25 16:02:04 +01:00
Christoph Anton Mitterer
5d79c012c4
ssh_filter_btrbk.sh: double quote variables expansions
...
Double quote any variable expansions that might ever contain field separators.
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
2023-03-25 16:02:04 +01:00
Christoph Anton Mitterer
1980c1d939
ssh_filter_btrbk.sh: use single quotes where possible
...
In strings that don’t contain `'` nor do any expansions, use single quotes to
avoid any future unintended expansions or escapes.
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
2023-03-25 16:02:04 +01:00
Axel Burri
a75765cc9a
btrbk: process all snapshots in snapdir (not only related ones)
2022-12-04 01:46:31 +01:00
Axel Burri
335e19e238
btrbk: allow quotes for all config values
...
Regression of:
9d217857
btrbk: fix parsing of quoted "target" config line
2022-12-04 00:50:21 +01:00
Axel Burri
f107507876
documentation: install add quick wget example in install
2022-12-03 12:10:05 +01:00
Axel Burri
1477fe5181
documentation: install: mention asciidoctor
2022-12-03 12:10:05 +01:00
Axel Burri
91b29ce32c
documentation: install: fix broken link to fedora rpms
2022-12-03 12:10:05 +01:00
Axel Burri
6b95250b84
documentation: install: move gentoo down
...
Trying to more or less sort by popularity / relevance.
Sadly Gentoo is not on the top list any more these days.
2022-12-03 12:10:05 +01:00
Christoph Anton Mitterer
36d6ba7d07
ssh_filter_btrbk.sh: disallow newlines in the SSH command
...
This disallows newline (that is: LF characters) in the SSH command, which could
have been exploited for arbitrary code execution, since commit
77a39282de
.
Example:
# export SSH_ORIGINAL_COMMAND=$'readlink /dev/stdout\ncat /etc/shadow'
# ssh_filter_btrbk.sh
Since `readlink` is a generally allowed command, this works with any of
ssh_filter_btrbk.sh’s options.
But most likely, other commands that are “added” via `allow_cmd()` can be used,
too.
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# Date: Wed Nov 30 04:29:53 2022 +0100
#
# On branch fix-remote-code-execution
# Your branch and 'origin/fix-remote-code-execution' have diverged,
# and have 1 and 1 different commits each, respectively.
# (use "git pull" to merge the remote branch into yours)
#
# Changes to be committed:
# modified: ssh_filter_btrbk.sh
#
# Untracked files:
# ORIG
#
2022-12-02 01:43:29 +01:00
Axel Burri
fa7ef1bf63
documentation: ssh_filter_btrbk: add note on --restrict-path
2022-11-21 13:10:42 +01:00
Axel Burri
f9c7a47b6a
btrbk: use substitutions in printf
...
Avoid possible interpreted sequence from values (e.g. from FILE).
2022-11-20 15:57:25 +01:00
Axel Burri
b800d1bb10
btrbk: strict input validation from kdf backend
2022-11-20 15:49:31 +01:00
Axel Burri
a622fded5a
btrbk: strict input validation from raw sidecar
2022-11-20 12:29:54 +01:00
Axel Burri
f8280f591f
btrbk: ignore redundand FILE from raw sidecar
...
If present, check against name calculated from raw info file name.
2022-11-20 11:19:49 +01:00
Axel Burri
7ad4ebe0af
btrbk: make safe_commands more restrictive
2022-11-20 11:19:14 +01:00
Axel Burri
7a4a54db97
btrbk: disallow newline in files
...
While most functionality works fine, raw backups fail to write correct
"FILE=" information in info sidecar.
Disallowing newlines in files is a good idea in general.
2022-11-20 02:40:15 +01:00
Axel Burri
87ed9ffeb5
btrbk: improve raw sidecar files parsing
2022-11-20 02:40:15 +01:00
Axel Burri
9d0468070d
btrbk-verify: do not use echo -e
2022-11-20 00:09:50 +01:00
Axel Burri
65886f10fd
btrbk-mail: do not use echo -e
2022-11-20 00:09:32 +01:00
Axel Burri
f52de197d6
btrbk: use printf instead of echo
...
Posix echo does not know about -e, -n flags, use printf instead.
2022-11-16 02:31:13 +01:00
Axel Burri
5c561d8c14
documentation: tidy --dry-run, --print-schedule examples
2022-11-16 01:37:12 +01:00
Axel Burri
125b37468a
btrbk: tidy comments
2022-11-16 00:45:39 +01:00
Christoph Anton Mitterer
914f9286c7
btrbk: add bzip3 compression
...
This adds support for bzip3 [1].
[1] https://github.com/kspalaiologos/bzip3
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Cosmetics: swap order pbzip2 / bzip3
Signed-off-by: Axel Burri <axel@tty0.ch>
2022-11-16 00:45:39 +01:00
Axel Burri
af86dc8c52
btrbk: allow compressors not to have a compression level
...
Not all compressors support compression level (option `-#`): print a
warning if compress_level is set, and ignore its value for such
compressors.
2022-11-16 00:44:53 +01:00
Christoph Anton Mitterer
af2d7b2c99
documentation: use "example.org" in examples
...
`mydomain.com` is actually a real domain and shouln’t be used in examples.
RFC 2606 (respectively RFC 6761) reserves `example.org` (and others) for that
purpose.
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
2022-11-12 15:19:24 +01:00
Christoph Anton Mitterer
1287547df0
documentation: use "restrict" in authorized_keys for further hardening
...
Since `btrbk` executes only commands, it shouldn’t need any of what’s currently
disabled with the `restrict` flag in the `authorized_keys` file, that is:
Port-, agent- and X11-forwarding as well as PTY allocation and execution of
`~/.ssh/rc`.
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
2022-11-12 15:17:28 +01:00
Axel Burri
9166d73be7
documentation: add send_protocol, send_compressed_data
2022-10-30 17:08:06 +01:00
Axel Burri
cc08cef27c
btrbk: add send_protocol and send_compressed_data config options
...
support btrfs send protocol v2
2022-10-30 17:08:06 +01:00
Axel Burri
1f7aa7e247
btrbk: unify btrfs send options
2022-10-30 17:08:06 +01:00
Axel Burri
af4681319c
btrbk: bump version to 0.32.6-dev
2022-10-30 17:08:05 +01:00
Axel Burri
58fffab405
change version to 0.32.5; update Changelog
2022-10-23 12:37:28 +02:00
Axel Burri
dcee6222be
btrbk: append to info file instead of rewriting
...
A redirection (e.g. `echo foo > bar.info`) can cause empty (zero-size)
files in some circumstances.
We still write INCOMPLETE=1 to the info file before send/receive, but
instead of re-creating it without the INCOMPLETE flag, we append
INCOMPLETE=0 (keeping up compatibility with old versions of btrbk).
Ref: 4e5ae975d8
btrbk: ignore zero-size info files
2022-10-19 11:38:11 +02:00
Axel Burri
51b2a5a9f5
btrbk: tidy comments
2022-10-19 11:38:11 +02:00
Axel Burri
25c8eb1705
btrbk: add timestamp to info file on write
2022-10-19 11:38:11 +02:00
Axel Burri
08cb900a9e
btrbk: add append option to system_write_raw_info
2022-10-19 11:38:11 +02:00
Axel Burri
89c0aa31d7
btrbk: tidy raw info file parsing
2022-10-19 11:37:45 +02:00
Axel Burri
d6910e43ea
btrbk: add append_to_file option in run_cmd
2022-10-19 11:33:40 +02:00
Matthieu Patou
4e5ae975d8
btrbk: ignore zero-size info files
...
When backuping from devices that have configured to use raw backup and
that might disconnect from the network (ie. laptops) you end up once in
a while with 0 size info file (and backup file).
btrbk don't know how to handle 0 file and stop backing up until the zero
size file is removed.
With this change 0 size info file will be ignored, and hence the backup
for the given backup will be redone.
Signed-off-by: Matthieu Patou <mat@matws.net>
2022-10-18 11:46:32 +02:00
Axel Burri
f77a33b340
btrbk: bump version to 0.32.5-dev
2022-10-18 11:08:31 +02:00
Axel Burri
6877825708
change version to 0.32.4; update Changelog
2022-08-20 14:26:36 +02:00
Axel Burri
116aface3c
btrbk: fix regression: wrong deprecation warnings
...
Warning for btrfs_commit_delete is always printed, regardless of the
(possibly valid) values.
regression in btrbk-0.32.3
687e0508b7
btrbk: tidy deprecation warnings
2022-08-20 14:24:17 +02:00
Axel Burri
411034e93f
change version to 0.32.3; update Changelog
2022-08-07 11:04:39 +02:00
xskoak
3149aa9e10
btrbk.conf.example: fix spelling
2022-07-28 13:59:01 +02:00
Axel Burri
79b6a662f2
btrbk: fix missing error in action "ls"
2022-07-28 13:44:42 +02:00
Axel Burri
cf2065df30
btrbk: hint missing ssh_identity on errors
...
It is perfectly ok to run btrbk without ssh_identity (using ssh
defaults), printing a warning if the option is not set is wrong.
Instead, hackily check for ssh_identity on ssh errors, and give a hint
in the error message.
2022-07-28 13:44:37 +02:00
Axel Burri
67020797ff
btrbk.conf.example: tidy ssh_identity, add backend_local_user
2022-07-28 13:02:22 +02:00
Axel Burri
a5dd4dd7b9
btrbk.conf.example: add local user on demand with ssh-agent
2022-07-28 13:01:56 +02:00
Axel Burri
19727e913b
documentation: drop deprecation notice
...
gt 2 years, deprecated since v0.28.0
2022-07-28 12:18:04 +02:00
Axel Burri
588fc7faa8
documentation: tidy man reference
2022-07-28 12:18:04 +02:00
Axel Burri
dc7b11653d
documentation: adapt ssh_identity and ssh_user option
...
also mention ssh-agent for ssh_identity option.
2022-07-28 12:17:16 +02:00
Axel Burri
2621fb38ba
btrbk: allow ssh_user=no
2022-07-28 12:10:06 +02:00
Axel Burri
dd638ec9f4
btrbk: allow ssh_identity=no
2022-07-28 12:06:22 +02:00
Axel Burri
f467de6c19
btrbk.conf.example: adapt btrfs_commit_delete
2022-07-28 12:06:22 +02:00
Axel Burri
c5dff6afda
documentation: adapt btrfs_commit_delete
...
Also move item down, closer to other delete-related options.
2022-07-27 20:41:59 +02:00
Axel Burri
6b465bf06b
btrbk: never delete multiple subvolumes at once
...
Deleting multiple subvolumes at once always caused the problem that we
need to parse stderr of "rm" and "btrfs subvolume delete" in order to
know which subvolume actually failed, which is problematic (version
dependent, language dependent). Also, we would need to restrict the
number of subvolumes based on the maximum allowed length for shell
commands, which is system-dependent (check `getconf ARG_MAX`).
Deleting subvolumes sequentially has slightly negative impact on
execution time (multiple rsh commands), with the benefit of being more
robust and reducing the codesize.
2022-07-27 20:41:25 +02:00
Axel Burri
b7df717611
btrbk: hide only fully deprecated keys when dumping
2022-07-27 18:36:20 +02:00
Axel Burri
687e0508b7
btrbk: tidy deprecation warnings
2022-07-27 18:20:33 +02:00
Axel Burri
c5cb919f6c
btrbk: tidy log functions
2022-07-27 18:19:46 +02:00
Axel Burri
805ab93fef
btrbk: fix function argument
...
Does not trigger a bug in current program logic.
Ref: 3ea7746700
btrbk: cosmetics: separate get_btrbk_date function
2022-07-27 14:35:24 +02:00
Axel Burri
43a125d4e1
btrbk: bump version to 0.32.3-dev
2022-07-27 14:35:15 +02:00
Axel Burri
bdc1f5caba
change version to 0.32.2; update Changelog
2022-06-25 18:52:11 +02:00
Axel Burri
054146ac00
btrbk: keep quotes intact when removing comments in config
2022-06-06 22:00:46 +02:00
Axel Burri
9d21785778
btrbk: fix parsing of quoted "target" config line
...
Quotes were removed before passing value to parse_config_line,
resulting in failuer of parsing target url if quoted.
2022-06-06 21:59:11 +02:00
Axel Burri
fb13848faf
btrbk: tidy function prototype
2022-06-06 21:02:13 +02:00
Axel Burri
f169456613
btrbk: tidy logging
2022-06-06 18:31:45 +02:00
Axel Burri
a062f42344
documentation: allow multiple gpg_recipient
2022-05-29 21:44:11 +02:00
Axel Burri
a70248376f
btrbk: use no-default-recipient on gpg encrypt
...
In case the user has set a default recipient in his gpg config file,
ignore it.
2022-05-29 21:34:43 +02:00
Steven Brudenell
b824d62449
btrbk: support multiple gpg recipients
2022-05-29 21:34:43 +02:00
Asbjørn Apeland
b618c2dd90
contrib: bash: completion.bash: complete options without =
...
Currently, option arguments are only completed after =. For example:
$ btrbk --loglevel=<TAB>
debug error info trace warn
$ btrbk --loglevel <TAB>
archive diff extents ls prune run
stats clean dryrun list origin resume
snapshot usage
This commit makes it so that both option styles are recognized:
$ btrbk --loglevel=<TAB>
debug error info trace warn
$ btrbk --loglevel <TAB>
debug error info trace warn
This was the intention all along, but it was implemented incorrectly.
2022-05-29 18:03:36 +02:00
Merlin Büge
a8a5051f79
documentation: README.md: replace "resume" with "robust recovery"
...
There was some confusion about it, see the discussion in
https://github.com/digint/btrbk/issues/196
2022-05-29 17:45:10 +02:00
Merlin Büge
1d4a502ee3
documentation: fix small typos and rephrase some parts
2022-05-29 17:21:29 +02:00
Axel Burri
0b41942251
github: add FUNDING.yml
2022-05-29 16:21:38 +02:00
Axel Burri
9e32df5f90
documentaion: README.md: rephrase donate section
2022-05-29 16:02:00 +02:00
Axel Burri
eadeb89232
btrbk: check results of btrfs filesystem usage
2022-05-29 14:32:27 +02:00
Axel Burri
691885e6b8
documentation: add compat=ignore_receive_errors option
2022-05-29 13:53:56 +02:00
Axel Burri
b8464119f6
btrbk: add compat=ignore_receive_errors option
2022-05-29 12:29:19 +02:00
Axel Burri
023d75f7a5
documentation: cosmetics
2022-05-29 12:29:16 +02:00
Axel Burri
619403c9ad
documentation: fix action "config print"
2022-05-29 12:29:13 +02:00
Axel Burri
527d1bf74f
btrbk: improve action "config print"
...
- honor overrides
- print unset lines as comments
- skip lines on forbidden context
- fix values "no" and "<unset>"
2022-05-29 12:26:37 +02:00
Axel Burri
f187d6f6ee
btrbk: tidy formatting
2022-05-29 12:26:37 +02:00
Axel Burri
321f3783d5
btrbk: use split in ssh_cipher_spec config definition
2022-05-29 12:21:39 +02:00
Axel Burri
ce2afb427d
btrbk: split all config values with same regex
2022-05-28 21:28:42 +02:00
Axel Burri
ba3ee70d38
btrbk: tidy config options definition
2022-05-28 21:28:39 +02:00
Axel Burri
823419d510
btrbk: tidy config options parser
...
- handle regex within accept list
- handle numeric as regex
- split before checking accept
2022-05-28 21:27:39 +02:00
Axel Burri
90c5d119f6
documentation: clarify btrfs_commit_delete
2022-05-27 20:14:02 +02:00
Axel Burri
267cbcacdc
documentation: clarify filter statement match multiple times
2022-05-27 19:31:48 +02:00
Axel Burri
04e0695429
btrbk: tidy logging
2022-05-27 19:31:48 +02:00
Axel Burri
12f608d828
btrbk: fix regression: clear realpath cache on mkdir
...
On btrbk archive, after creating a directory without dry-run, the
archive target is skipped with "Failed to fetch subvolume detail" due
to caching of realpath.
Regression in btrbk-0.32.0:
eb69bc883e
btrbk: refactor mountinfo
2022-05-27 19:31:48 +02:00
Axel Burri
4fcbbad802
btrbk: print version and help to stdout
2022-03-25 15:20:20 +01:00
Axel Burri
be07f1908a
btrbk: print shorter error help message
2022-03-25 15:20:14 +01:00
Axel Burri
fc49abbbf8
btrbk: bump version to 0.32.2-dev
2022-03-25 15:19:59 +01:00
Axel Burri
593fa6b254
change version to 0.32.1; update Changelog
2022-02-26 18:35:09 +01:00
Axel Burri
d9b9f20899
bump copyright year
2022-02-26 18:35:02 +01:00
Axel Burri
795418ebe1
btrbk.conf.example: remove timestamp_format
...
Now that timestamp_format defaults to "long", it seems no longer
needed to even mention it here. Setting to "short" or "long-iso" is
only required in rather special use cases.
2022-02-26 18:11:09 +01:00
Axel Burri
671df969a1
documentation: rephrase timestamp_format notes on preserve_hour_of_day
2022-02-26 18:11:09 +01:00
Axel Burri
047d3a1a65
btrbk: allow directory traversal for subvol_args
2022-02-26 18:11:09 +01:00
Axel Burri
a25486336b
btrbk: fix regression: filter paths for action "ls"
...
regression from: eb69bc883e
btrbk: refactor mountinfo
2022-02-26 18:11:09 +01:00
Axel Burri
ff0a887c32
btrbk: call filesystem usage from mount point
2022-02-22 20:28:23 +01:00
Axel Burri
e9fe2cb5f5
btrbk: display all source subvolumes in btrbk usage
2022-02-22 20:28:17 +01:00
Axel Burri
31ce14e4c2
btrbk: handle errors from btrfs filesystem usage
...
Fix `btrbk usage` unhandled error case if usage data cannot be
retrieved, e.g.:
ERROR: Failed to fetch btrfs filesystem usage for: example.com:/mnt/btr_pool
ERROR: ... sh: ssh -i 'XXX' btrbk@example.com 'btrfs-filesystem-usage '\''/mnt/btr_pool'\'''
ERROR: ... cannot access '/mnt/btr_pool': Permission denied
2022-02-22 20:28:01 +01:00
Axel Burri
0388cf4b2d
documentation: add backend btrbk-progs-doas
2022-02-08 01:20:24 +01:00
Axel Burri
177f8547e3
btrbk: add backend btrfs-progs-doas
2022-02-08 01:06:04 +01:00
Axel Burri
d3b7540b87
btrbk: tidy backend command map
2022-02-08 01:05:59 +01:00
Axel Burri
db7082b4bc
btrbk: add config_key_lru comfort function
2022-02-06 17:44:30 +01:00
Axel Burri
68d5fe3f55
btrbk: add match argument in config_key
2022-02-06 17:44:30 +01:00
Axel Burri
e6ed21343c
btrbk: remove dead code
2022-02-06 16:05:12 +01:00
Axel Burri
0172e4a240
btrbk: fix mountinfo tree root detection
...
Set node as tree root if mount_id == parent_id. For some reasons this
is never the case on my (mostly gentoo) systems.
Regression from: eb69bc88
btrbk: refactor mountinfo
2022-02-06 12:35:57 +01:00
Axel Burri
ed8142ed9d
btrbk: bump version to 0.32.1-dev
2022-02-06 12:35:53 +01:00
Axel Burri
8676191d45
change version to 0.32.0; update Changelog
2022-02-05 19:34:54 +01:00
Axel Burri
8cc74fecc1
btrbk: default timestamp_format=long
...
This is a relict of early days of btrbk, and I have already hesitated
for too long to change the default from legacy "short" to sane "long"
format.
Tests show that the scheduling behaves in a sane/expected way if this
change is applied unattended. I suppose everybody who has
preserve_hour_of_day set is already using timestamp_format=long.
2022-02-05 18:47:49 +01:00
znerol
c5273a8745
documentation: fix openssh website URL
2021-11-06 17:24:52 +01:00
Axel Burri
ca166d47b6
btrbk: add safe_commands config option
...
For the paranoid. For convenience, filename checking was removed in
[1], and quoting was (hopefully) implemented correctly in [2].
Allowing special characters as well as UTF8 leave behind a bad
feeling, as there are many special cases that needs to be taken care
of (e.g. newlines in file names, right-to-left encoding, etc.). In
order to mitigate attacks expoiting these error classes, leave an
option to power users which do only allow "sane" characters in their
filename hierarchy.
[1] 6a29b08f00
btrbk: remove filename restrictions
[2] acc7f9fc83
btrbk: quote unsafe characters in shell commands
2021-11-06 16:40:47 +01:00
Axel Burri
4f72ad123f
btrbk: tidy error message
2021-11-06 16:09:51 +01:00
Axel Burri
2b21d1528c
documentation: add "reference time" subsection
2021-11-06 13:50:38 +01:00
Axel Burri
ed814aed5a
documentation: rephrase retention policy
2021-11-06 13:27:22 +01:00
Axel Burri
cb38b7efa4
btrbk: parse additional "btrfs subvolume show" lines from btrfs-progs-5.14.2
2021-10-24 10:39:16 +02:00
Axel Burri
c538702d8c
btrbk: abort on unexpected only if receive target is not present
2021-10-04 19:17:36 +02:00
Axel Burri
4234fb2965
btrbk-verify: cleanup
2021-09-04 17:15:56 +02:00
Axel Burri
d554afab10
btrbk-verify: allow ssh-user without ssh-identity
...
Required e.g. if a ssh-agent is already running, and we want to set
user=root for rsync.
2021-09-04 16:57:05 +02:00
Axel Burri
bef13275d3
btrbk: fix regression: print quoted rsh command in table output
...
regression from: 27388c7589
btrbk: treat all filenames as unsafe
2021-09-04 15:46:57 +02:00
Axel Burri
1bda5fd978
btrbk: tidy safe_cmd; die if quoting leading dash for command
...
This should never happen, as all our filenames are checked to be
absolute.
2021-09-04 15:46:09 +02:00
Axel Burri
d1247359f8
btrbk: always return abort key
2021-08-28 14:49:12 +02:00
Axel Burri
faec607d02
btrbk: drop deprecated -r,--resume-only argument
...
Deprecated as of btrbk v0.26.0 (more than 3 years ago).
2021-08-28 14:06:10 +02:00
Axel Burri
3f84345bed
btrbk: tidy logging
2021-08-28 14:06:10 +02:00
Axel Burri
5dc2375a75
btrbk: fix raw file deletion
2021-08-28 14:06:10 +02:00
Axel Burri
424127441d
btrbk: fix unsafe path for btrfs send to file
2021-08-28 14:06:10 +02:00
Axel Burri
fe53198661
btrbk: drop support for deprecated raw format
...
Raw backups created by btrbk < 0.26.0 are now ignored:
*.btrfs_<received_uuid>[@<parent_uuid>][.gz|bz2|xz][.gpg][.split][.part]
2021-08-28 14:06:02 +02:00
Axel Burri
d7653a9e0a
documentation: add incremental_prefs; adapt incremental_clones
2021-08-27 17:20:47 +02:00
Axel Burri
85c2d14287
btrbk: change incremental_prefs defaults
...
New defaults gives the btrbk_direct_leaf snapshots higher preference
than the global ones resolved by parent-uuid (which are best-guess).
This way the parent has a higher chance of being a backup created by
btrbk, which results in "btrfs receive" to start work on a snapshot of
this (and preferably not on the "best-guess" ones).
2021-08-27 17:20:47 +02:00
Axel Burri
bde0c10a6c
btrbk: add incremental_prefs config option
2021-08-27 17:20:47 +02:00
Axel Burri
6ca00feeb6
btrbk: tidy parent selection
...
Preparatory for incremental_prefs feature, no functional changes.
2021-08-27 17:20:47 +02:00
Axel Burri
10a6f51730
btrbk: remove deprecation on incremental_clones
...
btrbk does not set config defaults to global scope for deprecated
keys.
2021-08-27 17:20:47 +02:00
Axel Burri
9f877a4670
btrbk: remove extra clone source, deprecate numeric incremental_clones
2021-08-27 17:20:47 +02:00
Axel Burri
1cb958ee30
btrbk: add "match" target for deprecated options
2021-08-27 17:20:39 +02:00
Axel Burri
ad6298bf37
btrbk: add global split_match (cosmetics)
2021-08-19 17:16:50 +02:00
Axel Burri
eb69bc883e
btrbk: refactor mountinfo
...
- Create tree from /proc/self/mountinfo, and use it to find mount
points.
- Populate realpath cache from mount points, possibly reducing calls
to `realpath`.
- Replace btrfs_mountpoint with vinfo_mountpoint(fs_type => 'btrfs)
- Tidy action "ls".
- Move code
2021-08-18 13:14:10 +02:00
Axel Burri
063c25ad24
btrbk: add sanity checks on mountinfo list
2021-08-18 13:14:10 +02:00
Axel Burri
2556492ec6
documentation: btrbk.conf.5: remove paragraph on filename restrictions
2021-08-18 13:14:10 +02:00
Axel Burri
6a29b08f00
btrbk: remove filename restrictions
2021-08-18 13:14:10 +02:00
Axel Burri
b8370de9de
documentation: terminate options using double dash "--"
2021-08-18 13:14:10 +02:00
Axel Burri
4b7b7cfc06
documentation: btrbk.1: rephrase --format=raw
2021-08-18 02:08:28 +02:00
Axel Burri
af5d25c5a9
btrbk-verify: expect single quotes from btrbk raw table output
2021-08-18 02:08:28 +02:00
Axel Burri
81a04e4287
btrbk: use single quotes for raw table format
2021-08-18 02:08:28 +02:00
Axel Burri
48bf4f05b9
btrbk: fix table output for utf8 characters (require Text::CharWidth)
...
Use Text::CharWidth::mbswidth() if installed, fallback to
length(Encode::decode_utf8()), fallback to length().
- Text::CharWidth handles wide chars (e.g. asian, taking up two
columns on the terminal) correctly.
- length(Encode::decode_utf8()) handles single-width chars only, and
should be installed on most systems (perl >= v5.7.3).
- langth() counts bytes, as we do not convert anything to UTF-8 in
btrbk (NOT using `perl -CIOEioA` or binmode(STDOUT, ":utf8"))
2021-08-18 02:08:28 +02:00
Axel Burri
94a415e420
btrbk: check/sanitize leading/trailing whitespace on files
2021-08-18 02:08:28 +02:00
Axel Burri
77a39282de
ssh_filter_btrbk.sh: allow quoted files
2021-08-18 02:08:28 +02:00
Axel Burri
f7d3823d5d
ssh_filter_btrbk.sh: fix files are always absolute
2021-08-18 02:08:28 +02:00
Axel Burri
3e9b581a54
btrbk: add --unsafe-filenames option
2021-08-18 02:08:28 +02:00
Axel Burri
1a7bbff767
btrbk: tidy run_cmd calls
2021-08-18 02:08:28 +02:00
Axel Burri
27388c7589
btrbk: treat all filenames as unsafe
2021-08-18 02:08:28 +02:00
Axel Burri
2933e65cbe
btrbk: adapt usage of unsafe arguments for run_cmd
2021-08-18 02:08:28 +02:00
Axel Burri
acc7f9fc83
btrbk: quote unsafe characters in shell commands
...
As filenames can contain meta characters like '$', we can't just put
ssh commands in double quotes. E.g. the following would trigger
variable expansion on local shell:
ssh example.com "ls -l 'evil$x'"
Instead, we quote the ssh using single quotes (adding the need to
escape single quotes), while also quoting unsafe filenames using
single quotes. The above becomes:
ssh example.com 'ls -l '\''evil$x'\'''
Or more complex, for a file named "file with'single quotes'":
ssh example.com 'ls -l '\''file with'\''\'\'''\''single quotes'\''\'\'''\'''\'''
On the remote shell, this will expand to:
ls -l 'file with'\''single quotes'\'''
2021-08-18 02:08:28 +02:00
Axel Burri
d7f6d5fecf
btrbk: accept quoted values in config
2021-08-18 02:08:28 +02:00
Axel Burri
5d94de9142
btrbk: use File::Spec for relative file arguments
2021-08-18 02:08:28 +02:00
Axel Burri
eccb24ecd7
btrbk: fix action "usage"
...
Regression from:
b658fba08c
btrbk: print snapdir and targets for action "usage"
2021-08-18 02:08:28 +02:00
Axel Burri
3cf69f3537
btrbk: add missing table ralign
2021-08-18 02:08:28 +02:00
Axel Burri
2f88d5ab4c
btrbk: check for deleted subvol before panicking
2021-08-18 02:08:28 +02:00
Axel Burri
6e7c8c409b
btrbk: cosmetics: fix trace log
2021-08-18 02:08:28 +02:00
Axel Burri
808633a3ae
btrbk-verify: remove workarounds for old versions; tidy eval
2021-08-09 19:06:20 +02:00
Axel Burri
d9958cbbc1
btrbk-verify: use new raw table format keys
2021-08-09 19:06:20 +02:00
Axel Burri
9278211123
btrbk: fix resolved ambiguity in raw table formats
...
rename snapshot_path -> snapshot_subvolume
rename target_path -> target_subvolume
These point to subvolumes, not paths containing subvolumes.
2021-08-09 19:06:20 +02:00
Axel Burri
2347163780
btrbk: table formats: replace source_path with source_subvolume
2021-08-09 19:06:20 +02:00
Axel Burri
e6106c3cda
documentation: btrbk.conf.5: optional volume section
2021-08-09 19:06:20 +02:00
Axel Burri
9a806d85ef
btrbk.conf.example: add simple (non-volume) example; cleanup
2021-08-09 19:06:20 +02:00
Axel Burri
89ea680ce2
documentation: README.md: consequently depict commands with hash
2021-08-09 19:06:20 +02:00
Axel Burri
1eee2c0d2e
documentation: README.md: add non-volume examples
2021-08-09 19:06:20 +02:00
Axel Burri
b658fba08c
btrbk: print snapdir and targets for action "usage"
2021-08-09 19:06:20 +02:00
Axel Burri
7603e03aad
btrbk: never match dummy volume section
2021-08-09 19:06:20 +02:00
Axel Burri
e1c5fd0029
btrbk: remove superfluous checks on volume
2021-08-09 19:06:20 +02:00
Axel Burri
47ea1f9481
btrbk: fix action "config print" for dummy volume section
2021-08-09 19:06:20 +02:00
Axel Burri
e257077241
btrbk: allow subvolume context without volume (add dummy section)
...
Unfortunately the framework relies on "url" for the volume. This
should not be printed anywhere, using "/dev/null" should be fine.
2021-08-09 19:06:20 +02:00
Axel Burri
e2de9de440
btrbk: expand subvolume globs independent of volume
2021-08-09 19:06:20 +02:00
Axel Burri
3b4f275126
btrbk: accept absolute path for subvolume
2021-08-09 19:06:20 +02:00
Axel Burri
d40d75ef76
btrbk: accept absolute path for snapshot_dir
2021-08-09 19:06:20 +02:00
Axel Burri
5b2644f12a
btrbk: fix check_file: accept both relative and absolute options
2021-08-09 19:06:20 +02:00
Axel Burri
d3d04f2252
btrbk: remove subvolume_path from schedule table
...
This is the only format where SUBVOL_PATH is displayed. As SUBVOL_PATH
is only available for vinfo_child, this can not be used in global
scope.
2021-08-09 19:06:20 +02:00
Axel Burri
c1610c754d
btrbk: cleanup: add config_subsection
2021-08-09 19:06:20 +02:00
Axel Burri
247cb37acf
btrbk: add comment on vinfo_child specific keys
2021-08-09 19:06:20 +02:00
Axel Burri
2d854c7327
btrbk: add comment on clone source from different mount point
2021-08-09 19:06:20 +02:00
Axel Burri
86e902cebc
btrbk: remove dead code
2021-08-09 19:06:20 +02:00
Axel Burri
ce9c21bd24
btrbk: tidy check for btrbk subvolume
...
The original idea was probably to have a trace log for skipped
subvols.
2021-08-09 19:06:20 +02:00
Axel Burri
f86c563715
btrbk: tidy superfluous subvol_dir argument
2021-08-09 19:06:20 +02:00
Axel Burri
2da30f6b96
btrbk: bump version to 0.32.0-dev
2021-08-09 19:06:20 +02:00
Ingmar Lippert
fa3204cd7e
documentation: README.md: fix spelling
...
spelling correction
2021-08-08 20:36:23 +02:00
Axel Burri
feba54a68d
change version to 0.31.3; update ChangeLog
2021-08-07 00:13:21 +02:00
Axel Burri
bddd7a1d69
Makefile: add btrbk_restore_raw.py to script install targets
2021-08-06 23:33:17 +02:00
fr3aker
82860f0f4c
btrbk_restore_raw.py: add script for restoring raw backups
2021-08-06 23:33:17 +02:00
ullr23@gmail.com
322ae2c78f
btrbk: add support for zstd adaptive compression
...
Requires zstd version >= 1.3.6
2021-08-06 17:51:20 +02:00
Axel Burri
907a5065ab
documentation: add "resume" example; rephrase "ondemand" example
2021-08-06 16:55:53 +02:00
Axel Burri
bf0b5997e8
btrbk: allow relative path arg for actions: archive, extents, diff, origin
2021-08-01 14:11:50 +02:00
Axel Burri
16cec0f6d4
btrbk: tidy map relative subvol argument
2021-07-25 13:32:27 +02:00
Axel Burri
2824668c0e
btrbk: fix path sanitizer
...
Sanitize "/././" -> "/"
2021-07-24 14:40:30 +02:00
Axel Burri
2616028326
documentation: README.md: rephrase note on ubuntu @subvol notation
2021-07-17 15:36:59 +02:00
Axel Burri
712910b440
btrbk.conf.example: tidy spacing
2021-07-16 13:20:25 +02:00
Axel Burri
346f08220e
btrbk.conf.example: revert to sane non-@subvol notation
...
We don't want to promote weird naming conventions here.
The idea behind the change in the previous commit [1] was to get rid
of confused people asking me: "hey, I don't have a subvolume for my
rootfs, all I see is @ and @home".
Left an example for "subvolume @" which should be clear to Ubuntu
people out there.
[1] de6c7ab586
btrbk.conf.example: use @subvol notation
2021-07-16 13:12:03 +02:00
Axel Burri
de6c7ab586
btrbk.conf.example: use @subvol notation
2021-07-15 14:51:30 +02:00
Axel Burri
ff9e4b5b5f
btrbk.conf.example: add timestamp_format
2021-07-15 14:51:30 +02:00
Axel Burri
f1a92e4141
btrbk.conf.example: add comments
2021-07-15 14:51:30 +02:00
Axel Burri
e110cc3e91
documentation: README.md: mention mandatory mounting of subvolid=5
2021-07-15 14:51:30 +02:00
Axel Burri
5524d16707
btrbk: add warn_unknown_targets config option
2021-07-15 14:11:03 +02:00
Axel Burri
54bb876b85
btrbk: tidy check_file
2021-07-15 14:11:03 +02:00
Axel Burri
47a3aa5849
btrbk: tidy assemble piped command; remove dead code
2021-07-15 14:11:03 +02:00
Axel Burri
af6d719acc
btrbk: fix: ignore mount points with unsupported filename in action "ls"
...
Mount points with illegal characters would die in vinfo. Print error
and ignore.
2021-07-15 14:11:03 +02:00
Axel Burri
12f6c5b69f
btrbk: tidy mountinfo comments
2021-07-15 14:11:03 +02:00
Axel Burri
6c13a64459
btrbk: fix mountinfo parsing (octal encoded chars)
...
Making sure this is done after splitting, as encoded value could be a
comma.
After some testing it shows that the kernel [1] produces ambigous
output in "super options" if a subvolume containing a comma is mounted
using "-o subvolid=" (tried hard to mount with "-o subvol=", seems not
possible via shell):
# btrfs sub create /tmp/btrbk_unittest/mnt_source/svol\,comma
# mount /dev/loop0 -o subvolid=282 '/tmp/btrbk_unittest/mount,comma'
# cat /proc/self/mountinfo
[...]
48 40 0:319 /svol,comma /tmp/btrbk_unittest/mount,comma rw,relatime - btrfs /dev/loop0 rw,ssd,noacl,space_cache,subvolid=282,subvol=/svol,comma
^^^^^^^^^^^^^^^^^^
[1] sys-kernel/gentoo-sources-5.10.45
2021-07-15 14:11:03 +02:00
Axel Burri
eac9ef9828
btrbk: print non-parseable btrfs mountpoint info only once
2021-07-15 14:11:03 +02:00
Axel Burri
db4f96ba65
btrbk: add function INFO_ONCE
2021-07-15 14:10:59 +02:00
Axel Burri
f5657bffc0
documentation: add -1,--single-column option
2021-07-15 13:50:11 +02:00
Axel Burri
2c19c501a7
btrbk: add "-1,--single-column" command-line option
2021-07-15 13:50:11 +02:00
Axel Burri
e82836be47
btrbk: add single_column output format
2021-07-15 13:50:11 +02:00
Axel Burri
c06d94543c
btrbk: add "backups" output format
...
Preparatory for single-column patchset.
2021-07-15 13:50:11 +02:00
Axel Burri
d80a8abb8a
btrbk: add "latest" output format
...
Same as "resolved", but hides target if none present.
2021-07-15 13:50:11 +02:00
Axel Burri
d7902fb30c
btrbk: rename action_list table formats
2021-07-15 13:50:11 +02:00
Axel Burri
f197a08650
btrbk: tidy table_formats
2021-07-15 13:50:11 +02:00
Axel Burri
bd68b15ebc
btrbk: tidy print_formatted
2021-07-15 13:50:11 +02:00
Axel Burri
37ef87ddaf
btrbk: add url to fs_list raw format
2021-07-15 13:50:11 +02:00
Axel Burri
cd69d29705
btrbk: tidy variable name
...
Duplicate use (not a bug)
2021-07-15 13:50:04 +02:00
Axel Burri
043e270522
btrbk: change version to 0.31.3-dev
2021-05-27 23:26:38 +02:00
Axel Burri
88d4cc76f3
documentation: move to irc.libera.chat
2021-05-27 23:26:38 +02:00
Axel Burri
c511fc9dd0
documentation: lsbtr.1: copy --format from btrbk.1
2021-04-20 21:02:51 +02:00
Axel Burri
fb792f67a3
documentation: README.md: mention common subvol naming
2021-04-20 21:02:51 +02:00
Axel Burri
e6cec73c8f
documentation: README.md: mention btr_pool mount point
2021-04-20 21:02:51 +02:00
Axel Burri
d2522c5836
documentation: mention preserve all snapshots on errors
2021-04-20 21:02:51 +02:00
Axel Burri
e8622fc6be
change version to 0.31.2; update ChangeLog
2021-03-21 13:34:26 +01:00
Axel Burri
3ba8c41e2f
documentation: README.md: rephrase ssh setup
...
- move ssh_filter_btrbk down
- move "further considerations" to "restrict access"
2021-03-21 13:28:18 +01:00
Axel Burri
58212de771
ssh_filter_btrbk.sh: fix alternation regex
...
Security vulnerability fixed in alternation regex. Specialy crafted
commands may be executed without being propely checked.
Affects all versions >= btrbk-v0.23.0
Regression from:
ccb5ed5e71
ssh_filter_btrbk: allow "realpath" and "cat /proc/self/mounts" on targets
Reported by: @protree (responsible disclosure)
2021-03-21 13:24:59 +01:00
Axel Burri
adc269a3dc
documentation: ssh_filter_btrbk: fix required commands
2021-03-20 15:49:08 +01:00
Axel Burri
fb11acf991
documentation: README.md: capital words in titles
2021-03-20 15:49:05 +01:00
Axel Burri
7f721afff5
documentation: README.md: improve ssh setup section
2021-03-20 15:46:13 +01:00
Axel Burri
c1fa4aa73e
documentation: README.md: rephrase time-machine example
2021-03-20 13:56:37 +01:00
Olivier Croquette
3bba963784
documentation: README.md: put simple example first
...
Until now the main README.md started with a pretty complex example, making
the learning curve unnecessary steep for new users. Start instead with the
simplier example with the local snapshots of 'home'. It was even simplified
a bit more to serve as good introduction, and step-by-step instructions were
added.
2021-03-20 13:56:37 +01:00
Axel Burri
ef7ad3205e
documentation: README.md: rephrase dryrun recommentation
2021-03-20 13:55:58 +01:00
Axel Burri
b8a6aaf799
btrbk: warn if no subvolume is configured
2021-03-18 20:03:03 +01:00
Axel Burri
a8341659be
btrbk: change version to 0.31.2-dev
2021-03-18 19:56:43 +01:00
Axel Burri
8402195487
change version to 0.31.1; update ChangeLog
2021-03-07 17:49:26 +01:00
Axel Burri
25c5e7b538
btrbk-mail: optionally prefix command output lines
...
Add configurable prefix for each line of command output. Seems wrong,
but outsmarts the mail clients.
The problem is that some (most?) mail clients outsmart the specs and
replace text/plain mails by quotations, emoticons, emphasis, ...
The only "correct" solution is to disable these features in the mail
client.
Acceptable workaround for #376 .
2021-03-07 17:18:39 +01:00
Axel Burri
db8cc1cd14
btrbk: collapse empty column in total of action "stats"
2021-02-27 13:26:31 +01:00
Axel Burri
713fe50372
btrbk: add empty_cell_char argument to print_formatted
2021-02-27 13:26:03 +01:00
Axel Burri
f3eb1ecb95
documentation: fix changed semantics in action "list snapshots"
2021-02-27 13:26:03 +01:00
Axel Burri
fe75b336be
documentation: add section for manually renamed snapshots
2021-02-26 19:58:29 +01:00
Axel Burri
cee6553a49
btrbk: fix duplicate snapshot location check
...
If snapshot_create=no, no snapshot is created and thus should be
excluded from "duplicate snapshot locations" check.
2021-02-14 15:05:03 +01:00
Axel Burri
8d25852ce2
btrbk: fix action "list all"
2021-02-14 14:23:17 +01:00
Axel Burri
9c2e4e1ee2
btrbk: change version to 0.31.1-dev
2021-01-16 20:40:49 +01:00
Axel Burri
4c0f7317fd
documentation: btrbk.conf.5: cleanup
2021-01-16 19:10:08 +01:00
Axel Burri
87623a80f5
documentation: btrbk.conf.5: fix cache_dir option
2021-01-16 19:10:08 +01:00
Axel Burri
7dc827bdc3
change version to 0.31.0; update ChangeLog
2021-01-10 16:54:53 +01:00
Axel Burri
28e5e08305
bump copyright year
2021-01-10 16:54:50 +01:00
Axel Burri
d8f95bb49e
documentation: btrbk.1: fix indentation
2021-01-10 16:54:50 +01:00
Axel Burri
82866e5b39
documentation: btrbk.conf.5: add reference to filter statements
2021-01-10 16:23:00 +01:00
Axel Burri
d0cf56fb67
documentation: rephrase key features; mention offline storage
2021-01-10 16:23:00 +01:00
Axel Burri
359c240108
documentation: mention action "extents" in key features
2021-01-10 16:22:54 +01:00
Axel Burri
ec0d201e2d
documentation: btrbk.1: mention lsbtr in action ls
2020-12-31 16:59:57 +01:00
Axel Burri
e0b8c0b34f
btrbk: consistently return array
...
While returning an arrayref might be slightly faster, consistently
return an array in all node lookup functions.
2020-12-30 17:57:39 +01:00
Axel Burri
42dd296ce7
btrbk: make related_nodes and correlated_nodes functions operate on nodes only
2020-12-30 17:57:23 +01:00
Lukas Straub
dd5991099a
btrbk: add suport for zstd long distance matching
2020-12-26 15:46:47 +01:00
Lukas Straub
3562e75a70
btrbk: add support for zstandard (zstd) compression
2020-12-26 15:46:20 +01:00
Axel Burri
3adf2f873b
documentation: describe columns of action "diff"
2020-12-21 00:33:23 +01:00
Axel Burri
6cce65e1eb
btrbk: remove big header in action "diff"
2020-12-21 00:30:06 +01:00
Axel Burri
c7dd838a81
btrbk: simplify action "diff"
2020-12-21 00:20:15 +01:00
Axel Burri
d0c5205fcb
documentation: custom table format
2020-12-20 20:12:46 +01:00
Axel Burri
2c4827ca9f
btrbk: support custom table format
2020-12-20 20:12:20 +01:00
Axel Burri
792c3de6c0
btrbk: separate format for "ist snapshots"
...
Make sure target_subvolume is always printed for "resolved" format.
2020-12-20 18:32:47 +01:00
Axel Burri
28d4ec6a0b
btrbk: print latest snapshot after latest correlated
2020-12-20 18:20:43 +01:00
Axel Burri
7340bdb5d6
contrib: bash: completion.bash: add action "list all"
2020-12-20 18:13:57 +01:00
Axel Burri
497b4e132e
contrib: bash: completion.bash: add action "extents"
2020-12-20 18:13:30 +01:00
Axel Burri
4fa6dfde25
btrbk: add target_type to "list config" table
2020-12-20 13:45:30 +01:00
Axel Burri
4f8274b28e
btrbk: collapse all target columns for "resolved" format
2020-12-20 13:45:30 +01:00
Axel Burri
1bd902d955
btrbk: collapse host columns for most formats
2020-12-20 13:45:30 +01:00
Axel Burri
a414a10448
documentation: adapt "list" command
2020-12-20 13:44:45 +01:00
Axel Burri
bba7c06486
btrbk: refactor action list and stats; add "list all"
2020-12-20 13:30:50 +01:00
Gavin Yancey
31475a303f
btrbk: look in the correct directory for btrbk list snapshots
2020-12-20 13:27:21 +01:00
Axel Burri
6669855936
btrbk: add source and target url to resolved raw format
2020-12-13 17:33:15 +01:00
Axel Burri
3ff42c60d1
btrbk: move snapshot_preserve column towards target_preserve
2020-12-13 17:29:48 +01:00
Axel Burri
4b7f4f6d81
btrbk: always collapse port and rsh columns
2020-12-13 17:29:05 +01:00
Axel Burri
16746caa16
btrbk: fix target_type column for "list backups" action
2020-12-13 15:07:29 +01:00
Axel Burri
557f2f5387
btrbk: add rsh column to list actions with format=long
2020-12-13 14:42:38 +01:00
Axel Burri
bda59056e8
btrbk: more accurate wording on type values for action list
...
Terminology for "backup" is specified in btrbk(1), use it:
Backup is a btrbk terminology for a "read-only subvolume created
with send/receive" (showing a received-uuid).
2020-12-13 14:05:34 +01:00
Axel Burri
33e3dee046
btrbk: fix action origin and ls
...
Regression:
a96c613ab8 btrbk: add subvol_args_init: map subvol_args cmdline arguments into vinfo
2020-12-12 21:43:23 +01:00
Axel Burri
53d5536929
btrbk: fix fs_path
...
Fixes action "origin" and logging.
Regression:
cc3f6c95b9
btrbk: return array in _fs_path
2020-12-12 21:43:23 +01:00
Axel Burri
8026fa3349
documentation: extents-diff: rephrase extents section
2020-12-12 21:43:23 +01:00
Axel Burri
db7e92b134
btrbk: extents-diff: add extents list command
2020-12-12 21:43:23 +01:00
Axel Burri
b01a97c36f
btrbk: extents-diff: more logging
2020-12-12 21:43:23 +01:00
Axel Burri
f9cc5af7b9
btrbk: extents-diff: add ID to long format
2020-12-12 21:43:23 +01:00
Axel Burri
63def23feb
btrbk: extents-diff: always display set-exclusive size
2020-12-12 21:43:23 +01:00
Axel Burri
e3987866d3
btrbk: extents-diff: fix logging, documentation
2020-12-12 21:43:23 +01:00
Axel Burri
59ee4d6ebf
documentation: better extents-diff documentation
2020-12-12 21:43:23 +01:00
Axel Burri
22b71bf7da
btrbk: extents-diff: list all related (not only older)
2020-12-12 21:43:23 +01:00
Axel Burri
208fc36231
btrbk: extents-diff: add (hidden) option: ignore_extent_data_inline
2020-12-12 21:43:23 +01:00
Axel Burri
0719fc415d
btrbk: cleanup aio extentmap
2020-12-12 21:43:23 +01:00
Axel Burri
dc1b7f1b5c
extents map: add alternative implementation using IO::AIO (slightly faster)
2020-12-12 21:43:23 +01:00
Axel Burri
70cdcb01c6
btrbk: cosmetics: fix spelling
2020-12-12 21:43:23 +01:00
Axel Burri
74a84f715b
btrbk: extents-diff: remove blocksize from regions
...
`filefrag -b1` effectively calculates byte regions.
2020-12-12 21:43:23 +01:00
Axel Burri
0977cb3184
documentation: btrbk.1: add action "extents-diff" (flagged as experimental)
2020-12-12 21:43:23 +01:00
Axel Burri
afd6f80739
btrbk: extents-diff: calculate exclusive size; add "exclusive" option
2020-12-12 21:43:23 +01:00
Axel Burri
ea2ec1ceaa
btrbk: print_formatted: allow custom format
2020-12-12 21:43:23 +01:00
Axel Burri
7facb44833
btrbk: add extentmap_cache (new cache_dir option)
2020-12-12 21:43:23 +01:00
Axel Burri
c6375967b8
btrbk: add action "extents-diff"
2020-12-12 21:43:23 +01:00
Axel Burri
1a96216e7b
btrbk: add subvol_args_init: map subvol_args cmdline arguments into vinfo
...
Preparatory for extents-diff command
2020-12-12 21:43:23 +01:00
Axel Burri
a8e82a6b2c
btrbk: add extentmap framework (filefrag)
...
Preparatory for extents-diff command
2020-12-12 21:43:23 +01:00
Axel Burri
3cbcc74bc3
btrbk: run_cmd: add large_output option (suppress stdout dump of command)
2020-12-12 21:43:23 +01:00
Axel Burri
03f7a8113d
btrbk-mail: cosmetics: fix documentation
2020-12-02 20:39:33 +01:00
Axel Burri
15d4a01b37
documentation: README.md: rephrase backup from non-btrfs source
2020-12-02 20:39:33 +01:00
Axel Burri
7b652b6227
documentation: strictly use capital letter at beginning of sentence
2020-12-02 20:09:00 +01:00
Asbjørn Apeland
ce660a4989
contrib: bash: completion.bash: complete options everywhere
2020-11-01 13:44:46 +01:00
Asbjørn Apeland
e4f27632a0
contrib: bash: completion.bash: add completion for lsbtr
2020-10-31 15:41:26 +01:00
Asbjørn Apeland
32c04e0b07
contrib: bash: completion.bash: complete commands
2020-10-31 15:27:50 +01:00
Asbjørn Apeland
ae67a670f0
contrib: bash: completion.bash: complete option values
2020-10-31 15:27:50 +01:00
Asbjørn Apeland
ac323e8b4b
contrib: bash: completion.bash: add Bash completion for options
2020-10-31 15:27:50 +01:00
Axel Burri
a99292aba8
btrbk: fix alignment if no header is printed
2020-10-30 19:09:50 +01:00
Axel Burri
528a152d6d
btrbk: action "diff": use print framework; convert units
2020-10-30 19:09:26 +01:00
Axel Burri
4866ec5cb0
btrbk: add print_size, and command line option modifier
2020-10-30 18:35:52 +01:00
Xiretza
f391c92d60
Makefile: fix race condition in `make install`
...
If run with -j, it's possible for install-bin-links to run before
install-bin and subsequently fail because $(BINDIR) hasn't been created
yet.
2020-10-30 16:43:02 +01:00
Axel Burri
81c92940c1
btrbk: fix unitialized value in warning
...
Regression from: 5c32ced7d6
2020-10-19 00:34:11 +02:00
Axel Burri
eb852271b6
btrbk: change version to 0.30.1-dev
2020-10-19 00:33:20 +02:00
Axel Burri
f40e3adce3
change version to 0.30.0; update ChangeLog
2020-09-23 15:48:44 +02:00
Axel Burri
838e132942
Makefile: change BINDIR from "/usr/sbin" to "/usr/bin"
...
With "backend btrfs-progs-btrbk" and "backend btrfs-progs-sudo", btrbk
does not necessarily need to be run as root.
2020-09-23 14:37:42 +02:00
Axel Burri
4d1b911947
documentation: btrbk.conf.5: clarify preserve_min
2020-09-23 12:59:50 +02:00
Axel Burri
373add933a
documentation: bump distro repository names
2020-09-23 12:59:50 +02:00
Axel Burri
e605bc7b42
btrbk: add backend_local_user config option
2020-09-23 12:59:50 +02:00
Axel Burri
13708abd00
btrbk: consequently fence all trace logs (for performance)
2020-08-29 13:29:17 +02:00
Axel Burri
5d81632b5d
btrbk: cosmetics on logging
2020-08-29 13:28:32 +02:00
Axel Burri
5c32ced7d6
btrbk: show paths from all mounts in fs_path; add _fs_info node resolver
...
Reference complete mountinfo in nodes, instead of { file, subvolid }.
2020-08-29 13:28:32 +02:00
Axel Burri
cc3f6c95b9
btrbk: return array in _fs_path
2020-08-29 13:28:32 +02:00
Axel Burri
fbfd1edc3d
btrbk: move mount info to front in fs_list table format
2020-08-29 13:28:32 +02:00
Axel Burri
739645444e
btrbk: dont show subvolume_rel_path in fs_list table format
2020-08-29 13:28:32 +02:00
Axel Burri
9415214bc0
btrbk: reword/fix verbose and loglevel options
2020-08-29 13:28:32 +02:00
Axel Burri
670170c3db
documentation: add lsbtr man page
2020-08-29 13:07:57 +02:00
Axel Burri
ec9998e866
btrbk: add lsbtr symlink
2020-08-29 13:07:57 +02:00
Axel Burri
3b2fad928b
Makefile: create "lsbtr" symlink on "install" build target
2020-08-29 13:07:57 +02:00
Axel Burri
910274f814
btrbk: support lsbtr symlink (alias for "btrbk ls")
...
If called via "lsbtr" symlink (program name):
- Provide user-friendly table options
- Assume "./" as path if no path arguments are given
2020-08-29 13:07:57 +02:00
Axel Burri
dff05bc6d7
documentation: README.md: add common rsync options
2020-08-29 12:34:49 +02:00
Axel Burri
c2308a52a6
btrbk-mail: add more elaborated email and rsync options
...
- If rsync is enabled, show number of created/deleted/transferred
files in mail subject.
- Add options to show summary and/or detail message in mail body.
- Add option to skip btrbk if no files were transferred via rsync.
- Add option to call sync(1) prior to running btrbk.
- Add option to skip btrbk execution if no files were transferred.
2020-08-29 12:31:18 +02:00
Axel Burri
ec037952cf
btrbk: add "compat" config option (busybox: add test -d command)
...
Add compat, compat_local, compat_remote configuration options.
Used for busybox: instead of running `readlink -e` (which is not
available on busybox), run `readlink -f` followed by `test -d`.
2020-08-28 21:19:21 +02:00
Axel Burri
52a823bb93
btrbk: rename context "root" to "global"
...
Use same naming as in documentation: btrbk.conf.5
2020-08-28 20:49:28 +02:00
Axel Burri
c81e390415
btrbk: cosmetics: capitalize debug logs
2020-08-28 20:48:17 +02:00
Axel Burri
a140cbd898
btrbk: case-insensitive match hostname/ipv6 in filter statement
2020-08-27 10:38:23 +02:00
Axel Burri
61419d420a
btrbk: add support for ipv6 addresses
2020-08-27 10:38:23 +02:00
Axel Burri
2f7e79ace6
documentation: mention up-to-date status
2020-08-20 18:53:46 +02:00
Axel Burri
12d80ee30b
btrbk: fix check on host
2020-08-20 17:02:45 +02:00
Axel Burri
b80d7e84de
btrbk: cosmetics on logging
2020-08-20 17:02:45 +02:00
Axel Burri
952e41443a
btrbk: always log target before source
...
Consistent for send/receive and send-to-raw.
2020-08-20 17:01:25 +02:00
Axel Burri
c11ab1507d
btrbk: sanitize url on PRINT
...
For consistency with PATH and URL, $vol->{PRINT} was not sanitized
(trailing "//" if parent is "/"). This is now dropped, as this is more
confusing than useful.
2020-05-24 02:48:12 +02:00
Axel Burri
936f88a68f
btrbk: action ls: support url argument; fix duplicates / sorting
2020-05-24 02:48:00 +02:00
Axel Burri
30edf5b766
btrbk: action ls: fix match on child subvols of "/"
...
If PATH contains double slash (intentional behavior of vinfo_child),
the match on root_path fails. Fixed by removing "//" from path.
2020-03-07 01:11:52 +01:00
Axel Burri
cb7d49d075
btrbk: change version to 0.29.2-dev
2020-02-29 17:40:55 +01:00
Axel Burri
e920283434
change version to 0.29.1; update ChangeLog
2020-02-09 16:18:00 +01:00
Axel Burri
73b339fe01
documentation: fix spelling
2020-02-09 16:14:50 +01:00
Axel Burri
d9e9f01e51
documentation: README.md: rewrite "restoring backups" chapter
2020-01-07 23:16:44 +01:00
Axel Burri
0c77219a62
documentation: README.md: fix backup restore example
...
Especially dont recommend deleting the transferred subvolume, this
would break incremental chain for subsequent backups.
2020-01-05 00:04:55 +01:00
Axel Burri
1b533f2340
documentation: README.md: add instructions for downloading latest master
2020-01-02 17:59:20 +01:00
Axel Burri
c03e960d90
ssh_filter_btrbk.sh: exclude "btrfs subvolume show|list" from restrict-path
...
btrbk requires "btrfs subvolume list|show" queries from the mount
point in order to build btrfs trees. This conflicts with tightly set
--restrict-path.
2020-01-02 17:56:03 +01:00
Axel Burri
5407b863df
documentation: btrbk.1: add missing option -L, --long
2020-01-02 16:58:07 +01:00
Axel Burri
0d19b0243e
btrbk: action ls: change default output to format=short
2020-01-02 16:58:07 +01:00
Axel Burri
c5b3ebb808
btrbk: action ls: allow multiple path arguments; soft fail on errors
2020-01-02 16:58:07 +01:00
Axel Burri
73c24e0495
documentation: btrbk.conf.5: explain stream_buffer_remote
2020-01-02 16:58:07 +01:00
Axel Burri
631a4c30fe
btrbk: fix @stderr propagation from vinfo_init_root
...
As we print @stderr in warnings if vinfo_init_root() function fails,
we need to make sure that @stderr contains sane values.
Clearing @stderr is required when calling caching functions!
2019-12-15 20:03:37 +01:00
Axel Burri
67d24695f1
btrbk: logging prints "..." on consecutive lines
2019-12-15 20:03:37 +01:00
Axel Burri
1f7773dddc
btrbk: try readlink only once per url
...
Change semantics of %realpath_cache: if "" (empty string), do not try
to run readlink shell command again on same URL.
2019-12-15 19:12:14 +01:00
Axel Burri
8c11c2eb7d
btrbk: run_cmd: fix regression: dont print ssh errors
...
Explicitely printing ssh errors (or even warnings) is
inconsistent. stderr is printed outside the run_cmd framework if
needed.
reverts a80e05984a
btrbk: catch ssh errors
See ssh(1):
ssh exits with the exit status of the remote command or with 255
if an error occurred.
Note that this includes network errors as well as dns failures
2019-12-15 19:12:06 +01:00
Axel Burri
9e13dbd933
btrbk: init sroot as late as possible when expanding wildcards
2019-12-15 19:10:01 +01:00
Axel Burri
37b30caeb2
btrbk: bugfix: vinfo_match: skip match against invalid paths
...
Dont check url_regex if $vinfo->{URL} is not a valid path (e.g. when
checking against a "volume" or "subvolume" having wildcards):
"Use of uninitialized value in join or string" at line 3030
2019-12-14 17:06:15 +01:00
Axel Burri
c36890e1eb
btrbk: change version to 0.29.1-dev
2019-12-14 17:05:54 +01:00
Axel Burri
a447c4b939
documentation: btrbk.conf.5: add note about ssh_compression / stream_compress relation
2019-12-07 14:07:56 +01:00
asymmetric
3694a38670
documentation: README.md: replace pv with mbuffer
...
Since 0.29, mbuffer is used instead of pv.
2019-10-30 18:24:35 +01:00
Axel Burri
b64ffbacf5
change version to 0.29.0; update ChangeLog
2019-10-27 14:00:40 +01:00
Ryan Young
0f21df15c2
ssh_filter_btrbk.sh: whitelist mkdir for 'btrbk archive' operations
2019-10-27 12:24:00 +01:00
Asbjørn Apeland
2d7f5ec5fe
contrib: systemd: btrbk.timer: change install target
...
Using `WantedBy=multi-user.target` makes boot wait for btrbk.service
before it's considered "finished". This can be checked by running
`systemd-analyze` or checking the system log using `journalctl`.
Timers should use the "timers.target" target, see systemd.special(7).
2019-10-27 12:24:00 +01:00
Axel Burri
a109a58b35
documentation: btrbk.1: cosmetics
2019-09-08 18:23:30 +02:00
Axel Burri
3631cf6c7f
ssh_filter_btrbk.sh: cosmetics: show unsafe character
2019-09-08 18:23:30 +02:00
Axel Burri
8551a9f52a
btrbk: consistently use "subvolume" (instead of "subvol") for table headings
2019-09-08 18:23:30 +02:00
Axel Burri
5e87e8248b
btrbk: add --pretty option: print lowercase column headings with separator line
2019-09-08 18:23:30 +02:00
Axel Burri
4629d5ae11
btrbk: change table output format: remove separator line, uppercase column headings
...
Print table output column headings single-line uppercase instead of
lowercase and underlined.
This is common ascii table format, is easy parseable and offers better
readability e.g. in pager.
2019-09-08 18:23:30 +02:00
Axel Burri
485bc3ab0c
btrbk: use global stderr (replace err); refeactor filter_stderr, add fatal_stderr
...
if fatal_stderr is set and returns true, the command exit code is set
to -1, resulting in run_cmd() returning undef.
2019-09-08 18:23:30 +02:00
Axel Burri
360c8918bb
btrbk: catch verbose errors from readlink
...
readlink -v enables "report error messages", printing useful errors
like:
readlink: /some/dir/: Permission denied
readlink: /some/dir/: No such file or directory
2019-09-08 18:23:30 +02:00
Axel Burri
6e4aeae323
btrbk: cosmetics: enhance trace log
2019-09-08 18:23:30 +02:00
Axel Burri
d0f0c18f64
btrbk: logging functions take array as argument
2019-09-08 18:23:29 +02:00
Axel Burri
fa3334cbb7
btrbk: btrfs_subvolume_list_readonly_flag: dont die on parse errors
2019-09-08 18:23:29 +02:00
Axel Burri
3798677893
btrbk: run_cmd: return array of stdout lines instead of scalar
2019-09-08 18:23:29 +02:00
Axel Burri
6227bb591a
ssh_filter_btrbk.sh: return exit status 255 on error
...
This makes btrbk regard ssh_filter_btrbk errors as ssh errors, as ssh
also returns exit status 255 if an error occurred.
2019-09-08 18:23:29 +02:00
Axel Burri
4e39ed0fca
btrbk: print ssh errors (remove -q option)
2019-09-08 18:23:29 +02:00
Axel Burri
9f347a1067
btrbk: use open3 in run_cmd: fetch stderr separately
2019-09-08 18:23:29 +02:00
Axel Burri
a80e05984a
btrbk: catch ssh errors
2019-09-08 18:23:29 +02:00
Axel Burri
df471c3692
btrbk: refactor filter_stderr; more flexible error handling in run_cmd; simplify btrfs_subvolume_delete parsing
2019-09-08 18:23:29 +02:00
Axel Burri
8434c6881c
btrbk: system_list_mountinfo: also fetch mount_options (not only super_options)
...
This should have no impact on current code: "subvol" and "subvolid"
are used, which are only in super_options.
2019-09-08 18:23:29 +02:00
Axel Burri
8570ee585d
btrbk: fix backup summary: dont display no_action if volume is skipped by --exclude or noauto
...
The backup summary does not print "<no_action>" if a subvolume is
skipped by --exclude or noauto. Alas, skipped volumes results in
no_action still being printed (see #291 ). Adding an additional
IS_ABORTED($sroot, "skip_") check fixes this issue.
2019-09-07 13:44:25 +02:00
Axel Burri
2c9f1389a0
btrbk: fix vinfo() prototype; remove dead code; fix scheduler text; fix action diff header text
2019-08-07 21:35:54 +02:00
Axel Burri
4845bc6691
btrbk: print_formatted: fix skip-row-if-empty for --print-schedule
...
Fix: dont modify "-" %table_formats hash key.
fixes 716d420a40
btrbk: print_formatted: add skip-row-if-empty functionality for table_formats
2019-08-06 17:29:45 +02:00
Axel Burri
3ea7746700
btrbk: cosmetics: separate get_btrbk_date function
2019-08-05 15:15:55 +02:00
Axel Burri
ac175c0093
btrbk: cosmetics: rename timestamp_postfix_match -> btrbk_timestamp_match
...
Take separator match "\." out of statement:
$timestamp_postfix_match == \.$btrbk_timestamp_match
Remove/Fix unneeded "timestamp" hash key (dead code).
2019-08-05 15:15:55 +02:00
Axel Burri
8b93ef7c82
btrbk: fix fallback_default_config
...
- add for action-archive
- exit if config is present but has parse errors
2019-08-05 15:15:55 +02:00
Axel Burri
3e40903720
btrbk: add btrbk archive --raw option
2019-08-05 15:15:30 +02:00
Axel Burri
dcc57abac4
btrbk: archive: also apply exclude patterns on source subvolumes
...
Allows patterns like "svol.2019*".
Needs @exclude_vf to be a global variable, which is ok as this only
holds command-line args (and global context for archive_exclude).
Note that adding the same in "create backups" (action run) and
macro_delete() is not a good idea, as this has weird implications on
the "forced: last" snapshot/backup pair.
2019-08-05 14:55:38 +02:00
Axel Burri
6e55e08db7
btrbk: add archive_exclude_older option: skip resume of old backups
2019-08-05 14:55:38 +02:00
Axel Burri
97240de0c9
btrbk: add -L, --long options (shortcut for --format=long)
2019-08-05 14:54:04 +02:00
Axel Burri
66d15d1d64
btrbk: action "ls": add mount_subvol column to long formats
2019-08-05 14:54:04 +02:00
Axel Burri
e297d37560
ChangeLog: adapt migration instructions for stream_buffer and rate_limit
2019-08-05 14:54:04 +02:00
Axel Burri
8d0d7edda7
ssh_filter_btrbk.sh: adaptions, use mbuffer for rate_limit
2019-08-05 14:54:04 +02:00
Axel Burri
c9fb366d09
btrbk.conf.example: suggest stream_buffer=256m; adapt text; add links
2019-08-04 23:08:11 +02:00
Axel Burri
06a7a53fee
documentation: btrbk.conf.5: add rate_limit_remote, fix stream_buffer / rate_limit text
2019-08-04 23:08:11 +02:00
Axel Burri
0435f32619
btrbk: add stream_buffer_remote, rate_limit_remote; run stream_buffer only on local host
...
Change sematics of stream_buffer: If set, run on local host only. If a
remote stream buffer is required, use stream_buffer_remote /
rate_limit_remote.
2019-08-04 23:08:11 +02:00
Axel Burri
73108d2309
btrbk: fix: "readonly" is required key for "btrfs subvolume show" output
...
The "Flags: readonly|-" line is present as of btrfs-progs v4.6.1, and
is required in "target metadata check" of btrfs_send_receive().
2019-08-04 13:52:45 +02:00
Axel Burri
74be074e6f
btrbk: remove warnings on superfluous "btrfs subvolume show" output
...
Silently accept compatible versions of btrfs-progs. Required keys are
being checked below, no need to warn here.
e.g. btrfs-progs >= v5.2.1 prints:
Quota group: 0/258
Limit referenced: -
Limit exclusive: 1.00GiB
Usage referenced: 16.00KiB
Usage exclusive: 16.00KiB
2019-08-04 13:29:39 +02:00
Axel Burri
7d656540d7
btrbk: fix btr_tree for subvolumes containing special (unsafe) characters
...
Note that any action (e.g. btrfs send -p) on a subvolume with unsafe
characters will still fail with:
ERROR: Unsafe command [...] (offending string: "/tmp/btrfs_pool/svol with spaces")
2019-07-31 13:44:30 +02:00
Axel Burri
10b826b5f3
documentation: btrbk.1: add action "ls"
2019-07-28 19:03:42 +02:00
Axel Burri
7271732f9e
btrbk: add action "ls": list all btrfs subvolumes below path
...
Features:
- get mounted filesystems from /proc/self/mountinfo
- fetch subvolumes using "btrfs subvolume list" (fast, needs root)
- filter and print subvolumes below mount point
2019-07-28 19:03:19 +02:00
Axel Burri
d88221e8bc
btrbk: add fallback_default_config action option, use for action "diff"
...
Preparatory for action "ls"
2019-07-28 19:03:19 +02:00
Axel Burri
381a12241b
btrbk: add dir_args: relative path arguments for actions reqiring directories
...
Preparatory for action "ls".
2019-07-28 19:03:19 +02:00
Axel Burri
217317b274
ChangeLog: add migration instructions; add mbuffer changes
2019-07-28 17:25:34 +02:00
Axel Burri
dc14611911
documentation: adapt rate_limit and --progress text
2019-07-28 17:25:34 +02:00
Axel Burri
9dc717c701
btrbk: use mbuffer instead of pv; add stream_buffer_sink framework
...
Add run_cmd option stream_buffer_sink, which handles stream_buffer,
rate_limit as well as --progress.
For rate limiting, run "mbuffer" (on the target host) in combination
with stream_buffer and --progress, instead of running "pv" (on the
source host).
Reasons:
- mbuffer limits the read rate: For remote targets, we want a stream
buffer in front of the rsh command pipe, before decompression.
- For local targets, this can be combined with --process.
- Combined stream_buffer and rate_limit: less commands in pipe.
Further changes:
- always set mbuffer -v1 option (never show warnings)
- restrict raw_target_block_size to "kmgKMG": compatibility to
stream_compress and rate_limit options, simplicity.
- use mbuffer blocksize option where applicable
2019-07-28 17:25:34 +02:00
Axel Burri
c7a8d0bb11
btrbk: fix naming: compress_cmd -> compress_cmd_text
2019-07-28 17:25:34 +02:00
Axel Burri
cf2c314627
btrbk: change version to 0.29.0-dev
2019-07-28 17:25:34 +02:00
Axel Burri
23770f2e67
change version to 0.28.3; update ChangeLog
2019-07-28 15:43:14 +02:00
Axel Burri
8ffd7ac1e9
btrbk: fix mount point resolving
...
Searching for longest match in mountinfo is plain wrong, as it is
possible (while very uncommon) to have a later mount point shadowing a
longer mount.
2019-07-18 15:34:52 +02:00
Axel Burri
fb3d4d96ff
btrbk: action origin: print uuid of unknown subvolumes
2019-07-15 18:36:12 +02:00
Axel Burri
5afa270577
btrbk: action origin: correctly handle root subvolumes having uuid
2019-07-15 18:36:06 +02:00
Axel Burri
8de7f45e89
btrbk: remove dead code
...
setting info{ERROR} does not make sense if info hash is not pushed to
SUBVOL_RECEIVED.
as of: c06bca17
2019-07-15 18:31:07 +02:00
Axel Burri
e7787e8a44
btrbk: replace "unrecoverable" hack by FIX_MANUALLY framework
2019-07-15 18:28:31 +02:00
Lubos Kolouch
836efa472b
btrbk: return error code 10 if unrecoverable problem
...
https://github.com/digint/btrbk/issues/285
2019-07-15 18:03:02 +02:00
Axel Burri
aaef1cd1e9
btrbk: change version to 0.28.3-dev
2019-07-15 17:50:50 +02:00
Axel Burri
31c25d0ee2
change version to 0.28.2; update ChangeLog
2019-05-23 14:11:33 +02:00
Axel Burri
0439e6079f
btrbk: fix vinfo_resolved
...
Fix for rare cases:
- fix for paths named "0"
- return undef if not strictly below $vol (or allow_equal is set)
2019-05-23 13:14:07 +02:00
Axel Burri
461eaada66
btrbk: rename "get_related_readonly_nodes" to "get_related_nodes"; add readonly and omit_self options
2019-05-23 13:14:07 +02:00
Axel Burri
f169ab4482
btrbk: cosmetics: test loglevel before dumping cmd return value (performance)
2019-05-23 13:12:45 +02:00
Axel Burri
45b487707f
btrbk: honor incremental_resolve on targets (fix: defaults to "mountpoint" instead of "directory")
...
Use $resolve_droot instead of $droot for calls to get_best_correlated
(probably missed commit), same as $resolve_sroot.
Fixes possible regression of:
514e69243a
btrbk: add "incremental_resolve" configuration option
2019-05-19 19:01:50 +02:00
Axel Burri
01230cde22
btrbk: bugfix: add missing (fake) mountpoint for raw targets
...
For raw targets, get_best_parent() dies as VINFO_MOUNTPOINT is not
defined on raw vinfo.
Fixes regression of:
d64e237e94
btrbk: get_best_parent: consider all parent/child relations
2019-05-19 15:27:27 +02:00
Axel Burri
538dab5396
btrbk: change version to 0.28.2-dev
2019-05-19 15:17:37 +02:00
Axel Burri
f132c94c65
change version to 0.28.1; update ChangeLog
2019-05-16 17:16:52 +02:00
Axel Burri
ef69f1ffee
documentation: remove pre-generated man pages
...
Package maintainers like to build everything from scratch, removing
overhead. Again, we apologize for the inconvenience.
Note that reproducible builds are still guaranteed by setting
SOURCE_DATE_EPOCH in doc/Makefile.
Reverts: a6dbd60e5a
documentation: add pre-generated man pages: from groff to asciidoc and back again
2019-05-16 17:06:15 +02:00
Axel Burri
f54853dd18
btrbk: cosmetics (trace logs)
2019-05-16 17:01:51 +02:00
Axel Burri
10bde449c6
btrbk: remove obsolete "resolve_subdir" option of vinfo_init_root
...
Removed in: b37ef84e36
btrbk: always read mountpoints
2019-05-16 17:01:51 +02:00
Axel Burri
b62bb3b1a8
btrbk: get_related_readonly_nodes: vastly increase abort_distance
...
It's not uncommon to have a large intact parent-chain on targets
(e.g. target_preserve_min=all).
If this is the case, performance drops a bit on "btrbk archive".
Note that we could limit the search depth in get_best_parent() for
some performance improvements, as this only affects extra clones.
2019-05-03 16:13:24 +02:00
Axel Burri
37b0bd3477
btrbk: bugfix: make get_related_readonly_nodes non-recursive
...
Perl hates recursions, and dies if recursion depth = 100:
Deep recursion on subroutine "main::_push_related_children"
Unfortunately this happens before the implemented abort condition
(distance=256).
Fixed by re-implementing get_related_readonly_nodes() non-recursive.
Refs: https://github.com/digint/btrbk/issues/279
2019-05-03 16:10:41 +02:00
Axel Burri
206e706d85
btrbk: allow overriding options with context restrictions
...
This allows commands like:
btrbk run mysubvol --override=snapshot_name=mysubvol-oneshot
2019-04-30 13:38:47 +02:00
Axel Burri
3d169d1df4
btrbk: change version to 0.28.1-dev
2019-04-30 13:38:33 +02:00
Axel Burri
a6dbd60e5a
documentation: add pre-generated man pages: from groff to asciidoc and back again
...
This reduces build-time dependencies to zero, helping package
maintainers and providing reproducible builds.
NOTE: generated man pages will only be updated on releases. In order
to make sure the docs are correctly rebuilt, run "make clean man". We
apologize for the inconvenience.
From Groff to Asciidoc and Back Again [1]
=========================================
| Comparison | Links |
| -------------------------------------------------------------------------| -------------------------------------------------------------------------------------------------------------- |
| **Plain ROFF** | |
| +++ Best result for `man` (our main goal!) | |
| - Not supported by github | [btrbk(1) v0.25.1 in plain groff](https://github.com/digint/btrbk/blob/v0.25.1/doc/btrbk.1 ) |
| - No decent converters: e.g. `groff -Txhtml -mandoc` | [btrbk(1) v0.25.1 at digint.ch (official site)](https://digint.ch/btrbk/doc/archive/btrbk-0.25.1/btrbk.1.html ) |
| | |
| **asciidoc** | |
| + Decent (scriptable!) html | [btrbk(1) v0.26.1 at digint.ch (official site)](https://digint.ch/btrbk/doc/archive/btrbk-0.26.1/btrbk.1.html ) |
| + Supported by github (helps contributors writing decent documentation) | [btrbk.1.asciidoc v0.26.1 at github](https://github.com/digint/btrbk/blob/master/doc/btrbk.1.asciidoc ) |
| | |
| **asciidoc (`xmlto`, `atx`)** | http://asciidoc.org/ |
| + Good result for `man` | |
| - EOL (why care that much? it works fine!) | [asciidoc EOL notice at github](https://github.com/asciidoc/asciidoc/releases/tag/8.6.10 ) |
| | |
| **asciidoc (`asciidoctor`)** | https://asciidoctor.org |
| - Pulls in tons of ruby (build depends) | https://bugs.gentoo.org/681056 |
| -- Implies to commit a pre-converted `doc/btrbk.1` | |
| + Seems more evolved than `xmlto`, still actively maintained | |
| | |
| **rst (`xrst2man.py` from docutils)** | |
| - Worse result for `man` | |
| ++ Good html converters (after having a quick look at it) | |
| - Not so well supported by github | [btrbk.1.rst v0.26.1 at github](https://github.com/digint/btrbk/blob/rst2man/doc/btrbk.1.rst ) |
[1] https://github.com/digint/btrbk/pull/219 (edited)
2019-04-24 19:45:54 +02:00
Axel Burri
fc485565ce
change version to 0.28.0; update ChangeLog
2019-04-24 19:45:09 +02:00
Axel Burri
5b34f620aa
documentation: reproducible builds: set SOURCE_DATE_EPOCH to " 📅 " tag
2019-04-24 19:41:14 +02:00
Axel Burri
e3176a0027
documentation: asciidoc: add "release-version" attribute, and append it to "man source" attribute
2019-04-24 19:41:14 +02:00
Axel Burri
818cc42d9b
documentation: Makefile: dont compress documentation by default
...
Many (all?) distro builds scripts want to do compression by their own.
2019-04-24 19:41:14 +02:00
Axel Burri
173319e7e1
documentation: Makefile: always build using asciidoctor (remove a2x)
...
Remove support for man page generation using asciidoc "a2x": The
project is discontinued, and depends on Python 2.7.
As we will provide pre-generated man pages as of btrbk-0.28.0, this is
not needed any more.
2019-04-24 19:40:59 +02:00
Axel Burri
d231a955ce
documentation: btrbk.conf.5: cosmetics: replace tabs with whitespace
2019-04-24 19:22:30 +02:00
Axel Burri
fe9ce255c5
remove experimental tag on "btrbk archive"
2019-04-24 19:22:30 +02:00
Axel Burri
725a284f16
documentation: README.md: adapt indentation in examples
2019-04-24 19:22:30 +02:00
Axel Burri
f5c7c74108
documentation: simplify examples, remove optional "send-receive" on "target" declarations
2019-04-24 19:22:29 +02:00
Axel Burri
cb1c12a6c1
documentation: btrbk.conf.5: more comprehensive text on "target" declaration
2019-04-24 13:52:05 +02:00
Axel Burri
6115cbdace
btrbk: make target_type optional for "target" section
2019-04-24 13:51:52 +02:00
Axel Burri
50267f1ca9
documentation: btrbk.conf.5: add warning on old versions of mbuffer
2019-04-24 12:53:19 +02:00
Axel Burri
e7793d9e06
documentation: README.md: add example command line for quick additional snapshot
2019-04-20 14:51:31 +02:00
Axel Burri
88b737d4b7
documentation: README.md: add multiple groups in virtual machine setup
2019-04-20 14:49:05 +02:00
Axel Burri
32d92ff3b7
btrbk: allow space separated groups
2019-04-20 14:05:42 +02:00
Axel Burri
0a2c5dbfb3
btrbk: use transaction for mkdir (cosmetics)
...
Prints correct "dryrun_success" (instead of "DRYRUN") in transaction
log.
2019-04-18 17:28:15 +02:00
Axel Burri
3d2936d40c
btrbk: fix regression for "btrbk archive -n"
...
resolve by mountpoint needs VINFO_MOUNTPOINT, which was not inserted
on fake mkdir:
514e69243a
btrbk: add "incremental_resolve" configuration option
2019-04-18 17:24:38 +02:00
Axel Burri
e36289a769
btrbk: use "archive_target" config context for archives
...
Distinguish normal "target" and (generated) "archive_target"
configuration context (printed in transaction log for
"abort_<context>" actions).
2019-04-18 16:40:25 +02:00
Axel Burri
a7da44cf2f
btrbk: bugfix: print aborted subvolumes to transaction log
...
Print all (deferred) actions to transaction log (file, syslog) in
init_transaction_log(), e.g. ABORTED() in "expand subvolume globs".
2019-04-18 16:28:53 +02:00
Axel Burri
25f0a76e28
btrbk: cosmetics: fix error message
2019-04-18 16:28:45 +02:00
Axel Burri
45b24d6477
documentation: btrbk.1: add "exclude" command line option
2019-04-18 15:09:15 +02:00
Axel Burri
14b5edcf68
documentation: btrbk.1: update filter statements section
2019-04-18 15:09:15 +02:00
Axel Burri
95819f03ea
documentation: btrbk.1: cosmetics: same order for options in all docs
2019-04-18 15:09:15 +02:00
Axel Burri
66004aeae8
documentation: btrbk.conf.5: add "noauto" option
2019-04-18 15:09:15 +02:00
Axel Burri
b6da6b0158
documentation: btrbk.conf.5: cosmetics, delete empty line
2019-04-18 15:09:15 +02:00
Axel Burri
b2f434b396
btrbk: add "exclude" command line option
2019-04-18 15:09:15 +02:00
Axel Burri
f0cff5ee5a
btrbk: add vinfo_filter_statement framework
2019-04-18 15:09:15 +02:00
Axel Burri
6e7d649588
btrbk: add "noauto" configuration option
2019-04-18 15:09:15 +02:00
Axel Burri
ae004e48fd
btrbk: map empty value to "yes" in configuration
2019-04-18 15:09:15 +02:00
Axel Burri
1503a07ad1
btrbk: enhance ABORTED framework (distinguish skipped and aborted)
2019-04-18 15:09:15 +02:00
Axel Burri
4224577960
btrbk: distinguish filter_args and subvol_args
...
preparatory for noauto and exclude options
2019-04-18 15:09:11 +02:00
Ian Kelling
ce15c19e44
Clarify license is gpl version 3 or later
...
https://www.gnu.org/licenses/identify-licenses-clearly.en.html
2019-04-16 11:04:16 -04:00
Axel Burri
ff23e9605b
btrbk: cosmetics: fix snapshot create debug log
...
Add additional log line, containing context for subsequent lines
2019-04-12 21:04:49 +02:00
Axel Burri
5697c38e4a
btrbk: globally rename snapshot_children to related_snapshots
...
As a consequence, also rename $child -> $snapshot
2019-04-12 21:04:49 +02:00
Axel Burri
0a93f69135
btrbk: treat all related readonly subvolumes within snapdir as "snapshots"
...
With this, previous snapshots (far relations) are still listed when
restoring a snapshot.
Example (S = source subvolume, readwrite):
After 3 snapshots:
A->S, B->S, C->S
Restore B: `btrfs subvol delete S; btrfs subvol snapshot B S'`
A->S, B->S, C->S, S'->B
Previous implementation would show now snapshots for S', as no
snapshot has parent_uuid=S'.
New implementation shows A, B, C as snapshots for S', as orphaned
siblings (A, B, C pointing to deleted S) are also related.
2019-04-12 21:04:48 +02:00
Axel Burri
adfdf925e2
btrbk: add btrbk_direct_leaf option for vinfo_resolved()
2019-04-12 21:04:48 +02:00
Axel Burri
318126b831
btrbk: disallow unrelated (by parent_uuid) parents for btrfs-send if incremental=strict
...
Makes sure that if, for whatever reason, a subvolume having correct
btrbk name scheme does NOT share any extents with previous snapshots
is never used as parent.
Note that if a related parent is found, the unrelated closest
older/newer (by btrbk timestamp) subvolumes are still added as clone
sources.
2019-04-12 21:03:40 +02:00
Axel Burri
c407d41db2
btrbk: unconditionally add clone sources to btrfs-send if necessary
...
Preferences for parent (and required clone sources):
1. closest older in snapdir (by btrbk timestamp), related
2. closest older related (by cgen)
3. closest newer related (by cgen)
4. closest older in snapdir (by btrbk timestamp)
5. closest newer in snapdir (by btrbk timestamp)
Note: prefering 1 over 2 helps keeping parent-chain within droot on
target (assuming that btrfs always uses correlated parent on
btrfs-receive).
This will e.g. add a clone source on "btrbk resume", if both older AND
newer snapshot/backup pairs exists.
Also makes sure that the closest older btrbk snapshot is always added
as clone source, even if another related subvolume has newer cgen.
2019-04-11 16:19:48 +02:00
Axel Burri
95e25eb2d1
btrbk: fix get_related_subvolume_nodes: add all parents and orphaned siblings
...
Old implementation was missing last readonly parent in chain, as well
as orphaned siblings.
Also sort all by cgen, not by distance, then cgen.
Also skip self.
2019-04-11 16:16:00 +02:00
Axel Burri
20c390893a
btrbk: honor multiple -v command line options (increase loglevel)
2019-04-05 19:29:37 +02:00
Axel Burri
3a753c9140
ChangeLog: add missing changes on btrbk-master (since 0.27.2)
2019-04-05 12:29:47 +02:00
Axel Burri
44edc97aef
btrbk: add "incremental_clones" configuration option (btrfs-send <clone-src>)
2019-04-05 12:06:41 +02:00
Axel Burri
f38c69316f
btrbk: get_best_parent(): add clone_src argument
2019-04-05 12:05:46 +02:00
Axel Burri
7cf1bfb354
btrbk: rename functions (use "correlated" where applicable)
...
_receive_target_nodes -> _correlated_nodes
get_best_receive_target -> get_best_correlated_target
2019-04-05 12:05:46 +02:00
Axel Burri
ce81350df0
btrbk: remove unused function: vinfo_subvol_list_all_accessible()
2019-04-05 12:05:46 +02:00
Axel Burri
514e69243a
btrbk: add "incremental_resolve" configuration option
...
Allowed values for "incremental_resolve":
- "mountpoint" (default): Use parents in the filesystem tree below
mount points of source `<volume-directory>/<snapshot-dir>` and
target `<target-directory>`.
- "directory": Use parents strictly below source/target
directories. Useful when restricting access, e.g. when using
ssh_filter_btrbk.sh.
- "_all_accessible" (experimental): Use parents from all mount points.
Note that using "_all_accessible" causes btrfs-progs to fail:
- btrfs send -p: "ERROR: not on mount point: /path/to/mountpoint"
- btrfs receive: "ERROR: parent subvol is not reachable from inside the root subvol"
see also: https://github.com/kdave/btrfs-progs/issues/96
2019-04-05 12:05:46 +02:00
Axel Burri
d64e237e94
btrbk: get_best_parent: consider all parent/child relations
2019-04-05 12:05:46 +02:00
Axel Burri
cb23c65eed
btrbk: get_related_subvolumes: add direct children from parent chain
2019-04-05 12:05:46 +02:00
Axel Burri
ad91b6f618
Makefile: add contrib/cron/btrbk-verify
2019-04-05 12:05:46 +02:00
Axel Burri
c1268cdd66
btrbk: table_format "transaction": make "*host" and "*port" keys skip-row-if-empty (for consistency)
2019-04-04 17:09:59 +02:00
Axel Burri
2e51de1047
documentation: README.md: add example: virtual machine setup
2019-04-01 20:12:38 +02:00
Axel Burri
cba4a93152
btrbk: table_formats: add "*port" keys (skip-row-if-empty)
2019-04-01 20:12:33 +02:00
Axel Burri
ca3bd505ef
btrbk: make check for duplicate snapshot/backup locations aware of shared btr_tree
...
Build check hash within btr_tree node instead per URL. This makes it
aware of shared btr_tree (different hostname:port pointing to same
btrfs filesystem).
2019-04-01 18:43:53 +02:00
Axel Burri
2f09a9a723
btrbk: virtual machine setups; use MACHINE_ID for caches; use port in URL
...
Common virtual machine setups have multiple volume sections with same
host, but distinct port numbers for each machine.
- make caches dependent on MACHINE_ID instead of HOST
- append port number to URL
- add MACHINE_ID to vinfo
- use MACHINE_ID where applicable
This even works if virtual machines share the same btrfs filesystems:
If a equal UUID is found on distinct machines, btr_tree() will return
the already present tree, in order to be consistent after node
injections.
2019-04-01 18:43:49 +02:00
Axel Burri
d8b7988ffa
btrbk: deprecate ssh_port option in favor of ssh://hostname[:port] notation
...
Setting the ssh port directly in the "volume" / "target" config lines
adds the possibility to have a create a unique "hostname:port"
identifier (preparatory for MACHINE_ID to distinguish virtual machines
on same host with different ports.)
2019-04-01 18:26:07 +02:00
Axel Burri
318e3af088
btrbk: table_formats: add skip-row-if-empty flag on all "*host"
2019-04-01 18:24:30 +02:00
Axel Burri
716d420a40
btrbk: print_formatted: add skip-row-if-empty functionality for table_formats
...
If the row key is prefixed with "-", and is all <undef>, omit output
of this row.
2019-04-01 18:22:30 +02:00
Axel Burri
805d7f4a0d
btrbk-verify: add workaround for btrbk <= 0.27.2 bug: missing target_rsh, target_type
...
btrbk <= 0.27.2 does not print "target_rsh" and "target_type" when
called with --format=raw, see $table_formats{resolved}. This is fixed
in 0.28.0.
Hardcoding target_type=send-receive is not so bad, as for raw targets
btrbk-verify complains first with:
btrbk-verify: missing required variable "target_rsh" in btrbk --format=raw line
So we should not run rsync (which is not really a problem, rsync just
fails with "not a directory").
2019-04-01 16:27:49 +02:00
Axel Burri
9ed41c8937
btrbk-verify: tool for automated backup integrity check based on rsync
...
Compare files and attributes by checksum, using rsync(1) in dry-run
mode with all preserve options enabled.
Resolves snapshot/backup pairs by evaluating the output of
"btrbk list latest [filter...]".
Restrictions:
- ".d..t...... ./" lines are ignored by default:
Root folder timestamp always differ.
- "cd+++++++++ .*" lines are ignored by default:
Nested subvolumes appear as new empty directories.
- btrbk raw targets are skipped
- rsync needs root in most cases (see --ssh-* options)
2019-04-01 16:27:45 +02:00
Axel Burri
0afc455c40
btrbk: fix table format "resolved": add target_type=send-receive|raw; add missing target_rsh
...
Required for "btrbk-check", which must be able do distinguish between
"send-receive" and "raw" targets.
2019-04-01 16:27:39 +02:00
Axel Burri
0699a860a9
btrbk: cosmetics: remove horizonal line in help message
...
This was added by mistake in:
96956959
btrbk: cosmetics: use heredocs for the help message
2019-04-01 15:31:58 +02:00
Axel Burri
e3a81c8126
btrbk: do not print help message if -q,--quiet is set
...
When called from another script, we dont want the help message printed
on errors. E.g. when running something like:
btrbk list snapshots -q filter_which_does_not_match
2019-04-01 15:31:58 +02:00
Axel Burri
6d465da6dc
btrbk: change version to 0.28.0-dev; bump copyright year
2019-03-29 04:35:35 +01:00
Axel Burri
bb2e9877b0
change version to 0.27.2
2019-03-26 15:08:55 +01:00
Axel Burri
dfabd4e856
documentation: btrbk.conf.5: move info about allowed characters to top section
2019-03-26 15:08:55 +01:00
Axel Burri
4a23568c40
documentation: btrbk.conf.5: remove unnecessary "{zwsp}" (zero width space)
2019-03-26 15:08:55 +01:00
Axel Burri
86a930daf1
Makefile: add option to bypass compression (COMPRESS=no)
...
While on traditional UNIX the documentation (especially the man pages)
are gzip'ed, modern distros have helpers to compress it.
This patch adds an option to disable compression:
make COMPRESS=no
2019-03-26 15:08:47 +01:00
Axel Burri
a412908451
Makefile: add documentation on "all" build target
2019-03-25 14:41:55 +01:00
Axel Burri
0e63843195
doc/Makefile: prefer asciidoctor (fallback to asciidoc) for man page generation
...
Changed preference for man page generation, as "asciidoc" is
discontinued and relies on python-2.7.
2019-03-25 14:37:35 +01:00
Axel Burri
6f68b713ee
btrbk: fix scheduler when overriding "target_preserve_min" in combination with global "target" section
...
When configuring "target" in a global (or "volume") context, and
overriding target_preserve_min in "subvolume" section, the scheduler
has undefined behavior (mixing up the "min" values).
Fixed by returning a copy of the preserve hash in
config_preserve_hash().
2019-03-04 16:05:38 +01:00
Axel Burri
17957a163a
btrbk: trigger autofs mount while resolving mountpoints
...
If resolved mount point has fs_type=autofs, trigger automount by
calling "btrfs subvolume show" on the mount point, and check mountinfo
again.
2019-01-17 16:43:42 +01:00
Axel Burri
f37a638f30
btrbk: bump version to 0.27.2-dev
2019-01-17 16:43:39 +01:00
Axel Burri
8abaed26c5
documentation: README.md: bump dependency >= btrfs-progs-4.12 (as of btrbk-0.27.0)
...
dependency introduced in:
0acbf74c
btrbk: add btrfs_subvolume_list_complete: fetch all subvolumes with all flags
2019-01-04 15:49:10 +01:00
Axel Burri
bd66f83663
btrbk: bump to forgotten dependency >= btrfs-progs-4.12 (as of btrbk-0.27.0)
...
dependency introduced in:
0acbf74c
btrbk: add btrfs_subvolume_list_complete: fetch all subvolumes with all flags
2018-12-25 22:20:24 +01:00
Axel Burri
e879620195
change version to 0.27.1
2018-12-05 22:18:19 +01:00
Axel Burri
e52153e13c
ChangeLog: add missing changelog for v0.27.1
2018-12-05 22:17:27 +01:00
Axel Burri
0e6c1f9025
btrbk: fix regression: call "sudo readlink" for backend=btrfs-progs-sudo
...
It is possible that the subvolume path is not accessible by the user
calling btrbk. When resolving mount points, "readlink" is used on the
path, which also needs to be wrapped with "sudo".
2018-12-05 22:01:07 +01:00
Axel Burri
ff011d55af
btrbk: fix "config print" command (undefined value in format_preserve_matrix())
...
regression: 5791d72171
btrbk: add "preserve_hour_of_day" configuration option
2018-12-05 21:43:54 +01:00
Axel Burri
de851955b6
btrbk: print_formatted: no blank lines for format: raw,tlog,syslog
2018-10-31 14:33:07 +01:00
Axel Burri
ebaaee2139
btrbk: print_formatted: omit title for format: raw,tlog,syslog
2018-10-31 14:06:14 +01:00
Axel Burri
74873081c3
btrbk: bump version to 0.27.1-dev
2018-10-31 13:57:06 +01:00
Axel Burri
c59488f405
change version to 0.27.0
2018-10-16 12:19:44 +02:00
Axel Burri
97e4a1e5d3
ChangeLog: add migration documentation regarding scheduler bugfix
2018-10-16 12:04:19 +02:00
Axel Burri
56ee8acf3b
btrbk: add "-S" command line option (shortcut for --print-schedule)
2018-10-15 16:25:07 +02:00
Axel Burri
7a8df85f2e
btrbk: fix regression: add node to return value of vinfo_resolved()
...
The FORCE_PRESERVE information is set on the node, and was lost for
"latest common target" as get_receive_targets() returned vinfo without
node information.
fixes regression: 6c502cb
btrbk: search complete target tree for correlated subvolumes
2018-10-15 16:19:52 +02:00
Axel Burri
49adbe6e28
documentation: README.md: explain send/receive using parent when restoring backups
2018-10-13 14:24:26 +02:00
Axel Burri
5c434bc197
documentation: cosmetics: delete trainling whitespace
2018-10-13 13:44:04 +02:00
Axel Burri
ad20b9a360
documentation: btrbk.1: explain root privileges and snapshot/backup terminology
2018-10-13 13:29:14 +02:00
Axel Burri
37def3dc7e
documentation: btrbk.conf.5: adaptions for backend and ssh_user option (cosmetics)
2018-10-13 13:29:14 +02:00
Axel Burri
f554a36978
documentation: adaptions for asciidoctor (literal blocks)
2018-10-13 13:29:14 +02:00
Axel Burri
d324f0d338
documentation: README.md: remove "upgrading from v0.22.2" section
...
This is more than two years old, everybody should have newer btrbk
release by now.
Note: "doc/upgrade_to_v0.23.0.md" is still available.
2018-10-13 13:29:14 +02:00
Axel Burri
c2a344fed1
documentation: move installation instructions from README.md to doc/install.md
2018-10-13 13:29:08 +02:00
Axel Burri
756e1e9449
documentation: remove broken link to gmane (received_uuid patch in kernel 4.4)
...
gmane is dead, see kernel patch:
b96b1db039 btrfs: fix resending received snapshot with parent
2018-10-11 16:03:31 +02:00
Axel Burri
0a4fb02eeb
documentation: change links to https
2018-10-10 23:11:44 +02:00
Axel Burri
526e332b02
ssh_filter_btrbk.sh: bugfix: ignore --restrict-path for "btrfs subvolume list"
...
btrbk now runs "btrfs subvolume list" from the mountpoint instead of
the volume path, which for some users is not below --restrict-path. As
the output of "btrfs subvolume list" is the same (complete btrfs tree
for the filesystem), it is ok to ignore the restrict-path here.
2018-10-10 22:51:13 +02:00
Axel Burri
f7ef5139de
documentation: rephrase ssh setup; cleanup
2018-10-10 00:58:38 +02:00
Axel Burri
c087082543
documentation: btrbk.1.asciidoc: add notes on propagation of filter statements
2018-10-09 15:21:30 +02:00
Axel Burri
3528927ea6
btrbk: bugfix: do not keep latest common snapshot for "incremental no"
...
There is no reason to keep the latest common source snapshot if
"incremental no" is configured (see #252 ).
2018-10-02 17:28:46 +02:00
Axel Burri
1862bc16d3
documentation: btrbk.1.asciidoc: add note about "prune": source/target must be accessible
...
Related to: c65f937473
2018-08-27 15:50:36 +02:00
Axel Burri
069304f3bb
btrbk: use system_list_mountinfo(), remove system_list_mounts(); rename fs_spec -> mount_source
...
Reasons for changing to `cat /proc/self/mountinfo`:
- `/proc/self/mounts` (or `/proc/mounts`) lacks extra info
(namespaces) and is not documented in kernel (deprecated?).
- findmnt(8) also uses /proc/self/mountinfo
Refs:
- https://www.kernel.org/doc/Documentation/filesystems/proc.txt
- https://bugzilla.redhat.com/show_bug.cgi?id=491924
- https://git.kernel.org/pub/scm/linux/kernel/git/bwh/linux-stable.git/commit/?id=2d4d4864ac08caff5c204a752bd004eed4f08760
2018-08-27 14:54:32 +02:00
Axel Burri
e02c2cf249
btrbk: add system_list_mountinfo: parse /proc/self/mountinfo
...
preparatory patch for removing system_list_mounts().
2018-08-27 14:52:28 +02:00
Axel Burri
37c0e840e9
btrbk: bugfix: use latest longest match for resolving mount point (e.g. for autofs)
2018-08-27 14:49:04 +02:00
Paride Legovini
3dc06c8067
documentation: btrbk.conf.5: clarify behavior of 'snapshot_create ondemand' when there are multiple targets
2018-07-30 03:28:18 +02:00
Axel Burri
0d124a4373
btrbk: fix regression in get_related_subvolumes(): correctly match same btrbk file name scheme
...
Since we consider all accessible subvolumes in get_related_subvolumes,
checking for equal BTRBK_BASENAME and empty SUBVOL_DIR does not work
when checking for same btrbk file name scheme.
fixes regression: b37ef84e36
(btrbk: always read mountpoints; include all snapshots from mountpoint as candidates for best common parent)
2018-07-18 16:13:33 +02:00
Axel Burri
bf5fd7a90b
btrbk: cosmetics: fix prototype of get_related_subvolumes()
2018-07-18 16:13:29 +02:00
Axel Burri
1242913d9b
btrbk: cosmetics: rename variables (spec -> fs_spec)
2018-07-12 18:26:35 +02:00
Axel Burri
5b1b99c4ed
documentation: btrbk.conf.5: add explanation on hostname and caches
2018-07-12 18:26:35 +02:00
Axel Burri
78cec36e30
ssh_filter_btrbk: tighten decompress match expression
2018-07-12 18:26:35 +02:00
Axel Burri
47f6f730ab
btrbk: cosmetics: change error message in btrfs_subvolume_delete; add comments
2018-07-12 18:26:35 +02:00
Axel Burri
faec212324
btrbk: check if received subvolume is really garbled before deleting it
...
Improve error handling in btrfs_send_receive: on error, always try to
read the target subvolume and only delete it automatically if it is
garbled (read/write, no received_uuid).
This is especially important if the target subvolume was already
present before send/receive.
Reverts: 4c4afe77
btrbk: skip target metadata test if send/receive has errors
2018-07-12 18:26:35 +02:00
Axel Burri
de57efff82
btrbk: bugfix: print all errors if send/receive fails
...
If stream_compress is enabled and compress command is not found, we
now print "command not found".
2018-07-12 18:26:34 +02:00
Axel Burri
9aeaf2b15c
btrbk: fix regression introduced with btrfs_subvolume_list_complete
...
If btrfs_subvolume_show($vol, rootid => 5) fails, there are no
"received_uuid" and no "gen" keys in the root node.
Fixes: 0acbf74c57
(btrbk: add btrfs_subvolume_list_complete: fetch all subvolumes with all flags)
2018-07-09 18:46:24 +02:00
Axel Burri
669a34357a
btrbk: bugfix: handle corner case: url="ssh://my.host" (without trailing slash)
...
As we allow <url> to be specified as "<hostname>:<directory>", an URL
"ssh://my.host" (without trailing slash) was parsed as hostname="ssh",
directory="/my.host".
2018-07-09 16:13:48 +02:00
Axel Burri
c2022a5b2f
documentation: add text for "subvolume ." configuration
2018-07-09 16:13:00 +02:00
Axel Burri
0acbf74c57
btrbk: add btrfs_subvolume_list_complete: fetch all subvolumes with all flags
...
Wrapper, returns complete list of all subvolumes (including btrfs
root, id=5) with all flags. Requires three calls to btrfs-progs.
Adaptions and cleanup in btr_tree().
2018-07-09 16:13:00 +02:00
Axel Burri
d15133b3d4
btrbk: snapshot_name defaults to volume name if subvolume name is "."
2018-07-09 16:13:00 +02:00
Axel Burri
7088a91fa3
btrbk: cosmetics: sanitize trailing "/." in check_file()
2018-07-09 16:13:00 +02:00
Axel Burri
de5004c744
btrbk: abort subvolume if it is btrfs root (id=5)
...
Btrfs root subvolume (id=5) have no UUID and cannot be backed
up. Abort if "subvolume ." is configured on btrfs root, e.g.:
volume /path/to/btrfs_root
subvolume .
2018-07-09 16:13:00 +02:00
Axel Burri
b0d58fd0f1
btrbk: btr_tree: always read btrfs root node (id=5), hoping to get its uuid
...
Note that the UUID for btrfs root (id=5) is not always present:
- btrfs-progs < 4.12 does not support rootid lookup
- UUID can be missing if filesystem was created with btrfs-progs < 4.16
Still we need to always read it, as the whole tree is cached and we
don't know if it will be used.
2018-07-09 16:13:00 +02:00
Axel Burri
cb5e361f7a
btrbk: add --rootid command option for "btrfs subvolume show"
2018-07-09 16:13:00 +02:00
Axel Burri
1aa0fe1aad
btrbk: remove obsolete realpath_cache update in btrfs_subvolume_show()
...
Recent btrfs-progs do not print the real path any more, this is now
handled by btrfs_mountpoint() -> system_realpath().
2018-07-09 16:13:00 +02:00
Axel Burri
177671e920
btrbk: validate output of "btrfs subvolume show"; also return uuid for btrfs root (if present)
...
Filesystems created with btrfs-progs < 4.16 have valid UUID, while
others have not [1]. Validate output of "btrfs subvolume show", and
provide uuid for btrfs root (id=5) only if it is valid.
[1]: 0a0a03554a: btrfs-progs: mkfs: add uuid and otime to ROOT_ITEM of, FS_TREE
2018-07-09 16:13:00 +02:00
teesid
9c70231859
btrbk: allow backup of subvolume (subvolid != 5) mounted at "/"
...
It works with the configuration snippet below if subvolid != 5:
```
volume /
subvolume .
snapshot_name root
```
2018-07-09 16:13:00 +02:00
Axel Burri
2f95baf6f3
documentation: adaptions for asciidoctor (ifdefs, literal blocks)
...
When using asciidoctor, backend "manpage" (-b manpage) is used, while
a2x converts asciidoc to docbook (xml), then manpage.
Asciidoctor creates ugly indentation for [literal] blocks in SYNOPSIS,
use [verse] instead.
2018-06-25 20:49:24 +02:00
Axel Burri
3e9066337a
documentation: fallback to asciidoctor if asciidoc (a2x) is not present
...
Asciidoc is EOL and only supports python2. Provide a fallback to
Asciidoctor for manpage generation.
Reference: https://github.com/digint/btrbk/pull/219
2018-06-25 20:46:00 +02:00
Axel Burri
a0f6b55d28
btrbk: fix regression: undefined array reference when no received_uuid present
...
fixes #239 (@ian-kelling)
2018-06-25 13:30:14 +02:00
Samantha McVey
211943d4af
btrbk: cosmetics: reformat a regex to be much more readable
2018-06-04 11:39:52 +02:00
Samantha McVey
969569592a
btrbk: cosmetics: use heredocs for the help message
...
Avoids use having to use 40 print's and having to quote each line and is
much easier to edit.
2018-06-04 11:39:03 +02:00
Axel Burri
1d0d57ffac
documentation: btrbk.conf.5: add more text on file names and urls
2018-05-31 00:36:46 +02:00
Axel Burri
391e50b872
btrbk: do not warn on non-parseable btrfs mountpoint
...
Many people use whitespace even in mountpoints, silently ignore
(loglevel=info) non-parseable btrfs mountpoints.
Btrbk does not support file names with whitespace or special
characters by design, and specifying such mountpoints in the
configuration file fails anyway.
2018-05-31 00:34:50 +02:00
Axel Burri
ffba3e47c6
documentation: ssh_filter_btrbk.1.asciidoc: fixes, cleanup
...
- add add "always allowed" commands (as bullet list)
- remove deprecated "-c, --compress"
2018-05-15 00:06:53 +02:00
Axel Burri
2f56c55120
btrbk: fix regression: actions "list snapshots/backups" print all snapshots under sroot (not snaproot)
...
Regression from: c457540ce3
2018-05-14 23:43:13 +02:00
Axel Burri
09918bf5af
btrbk: cosmetics: print (fix) reason why snapshots/backups are skipped/preserved
2018-05-11 00:17:52 +02:00
Axel Burri
9ae823a757
btrbk: cosmetics: remove too chatty debug log
2018-05-10 15:44:46 +02:00
Vít Novotný
c8fcb01bc2
btrbk: bugfix: do not read target btrfs tree on "btrbk snapshot --preserve"
...
If running "btrbk snapshot --preserve", there is no need to initialize
targets, and we don't want to warn and fail (exitcode=10) on missing
targets.
2018-05-10 15:18:36 +02:00
Axel Burri
17f41118d3
btrbk: bugfix: compare all mountpoints while resolving
...
When comparing longest match in mounts, all mountpoints have to be
taken into account (not only the btrfs mount points).
2018-05-10 14:02:44 +02:00
Axel Burri
847be88142
ChangeLog: add changes to internal data structures
...
Covers commits:
1c83a65
btrbk: add filter capabilities to vinfo_subvol_list
a25487e
btrbk: cosmetics (log messages)
ef5c369
btrbk: use _is_same_fs_tree() where applicable
0454f60
btrbk: bugfix: match btrbk_basename in get_latest_snapshot_child()
2c1c3b4
btrbk: cleanup: remove snapshot_dir, rename sroot->snaproot
c457540
btrbk: use separate vinfo for snapshot directory (allows snapshot_dir to be a mountpoint)
f5dc4e0
btrbk: add known mountpoints to btr_tree nodes as anchor for reverse lookup
e9374b3
btrbk: replace url_cache by spec_cache
0ea0430
btrbk: cleanup (cosmetics, documentation)
b37ef84
btrbk: always read mountpoints; include all snapshots from mountpoint as candidates for best common parent
b549e11
btrbk: raw targets: move tree readin to separate function; add caching
7a1bc25
btrbk: raw targets: create fake btr_tree instead of maintaining separate list
6c502cb
btrbk: search complete target tree for correlated subvolumes
2018-05-10 12:03:51 +02:00
Axel Burri
1c83a6545d
btrbk: add filter capabilities to vinfo_subvol_list
...
Clean up (and speedup) code by filtering while building the list
instead of checking every item after building.
2018-05-10 11:48:34 +02:00
Axel Burri
a25487e873
btrbk: cosmetics (log messages)
2018-05-10 11:48:34 +02:00
Axel Burri
ef5c369a37
btrbk: use _is_same_fs_tree() where applicable
2018-05-10 11:48:34 +02:00
Axel Burri
0454f60ad1
btrbk: bugfix: match btrbk_basename in get_latest_snapshot_child()
2018-05-10 11:48:34 +02:00
Axel Burri
2c1c3b4d54
btrbk: cleanup: remove snapshot_dir, rename sroot->snaproot
2018-05-10 11:48:34 +02:00
Axel Burri
c457540ce3
btrbk: use separate vinfo for snapshot directory (allows snapshot_dir to be a mountpoint)
...
Instead of passing snapshot_dir all over the place, use a separate
vinfo for the snapshot directory, accessible by vinfo_snapshot_root().
As it is initialized separately by vinfo_init_root(), it can be on a
different mountpoint.
This also allows us to use different semantics for snapshot_dir in the
future, as it does not need to be relative to the volume directory.
2018-05-10 11:48:34 +02:00
Axel Burri
f5dc4e0a36
btrbk: add known mountpoints to btr_tree nodes as anchor for reverse lookup
2018-05-10 11:48:34 +02:00
Axel Burri
e9374b3b1d
btrbk: replace url_cache by spec_cache
2018-05-10 11:48:34 +02:00
Axel Burri
0ea0430c43
btrbk: cleanup (cosmetics, documentation)
2018-05-10 11:48:34 +02:00
Axel Burri
b37ef84e36
btrbk: always read mountpoints; include all snapshots from mountpoint as candidates for best common parent
...
Dropped readin of subvolid and realpath by btrfs_subvolume_show(), we
now always read /proc/self/mounts (and call readlink).
When picking the best common parent in get_best_parent(), we want to
list as many snapshots as possible. For now, we list all from the
mountpoint of snaproot ($sroot/<snapshot_dir>), due to a bug in
btrfs-progs [1]. Also added code (commented out) to list snapshots
from all known mountpoints.
[1] https://github.com/kdave/btrfs-progs/issues/96
2018-05-10 11:48:05 +02:00
Axel Burri
b549e11b43
btrbk: raw targets: move tree readin to separate function; add caching
...
Adds new function vinfo_init_raw_root(), similar to vinfo_init_root().
Note that we don't (yet) resolve realpath for raw targets.
2018-05-10 11:36:21 +02:00
Axel Burri
7a1bc257c1
btrbk: raw targets: create fake btr_tree instead of maintaining separate list
2018-05-10 11:36:21 +02:00
Axel Burri
6c502cbdcc
btrbk: search complete target tree for correlated subvolumes
...
- move matching for correlated subvolumes from get_receive_targets
into new function _receive_target_nodes
- add lookup tables in btr_tree (RECEIVED_UUID_HASH, UUID_HASH),
allowing for faster matching in _receive_target_nodes
- add vinfo_resolved() for mapping nodes to vinfo
- rename get_latest_common to get_best_parent (while moving some
functionality to new function get_related)
- cleanup
2018-05-10 11:36:21 +02:00
Axel Burri
490f680f41
btrbk: bugfix: add backend mappings for "btrfs filesystem usage"
2018-04-30 14:15:30 +02:00
Axel Burri
c65f937473
documentation: btrbk.1.asciidoc: add note about snapshot deletion for action "snapshot"
2018-04-16 12:27:54 +02:00
Axel Burri
719fb5fb74
btrbk: bugfix: correct scheduling of "first weekly backup in month/year"
...
In the scheduler, a month (or year) does not start at the first day,
but at the first `preserve_day_of_week`. Make sure that all days
before `preserve_day_of_week` in a month get delta_months+1.
Example (corner case):
- `preserve_day_of_week sunday`
- `target_preserve *m`
- no backups in 2018-02
- backup with timestamp 2018-03-01 (which is a thursday)
- backup with timestamp 2018-03-04 (which is a sunday)
Without this patch, because there are no sunday backups in 2018-02,
the first backup is considered a weekly (+4d after sunday), and as
such "first weekly of month 2018-03", and the second one is discarded.
With this patch, the first item is considered "first weekly of month
2018-02", and the second gets "first weekly of month 2018-03".
NOTE: This change may result in (previously preserved) backups to be
deleted!
2018-04-05 18:00:29 +02:00
Axel Burri
e9c30e91fb
documentation: btrbk.conf.5.asciidoc: enhance text on retention policy options
2018-04-05 18:00:29 +02:00
Axel Burri
e4a0938712
btrbk: ignore "preserve_hour_of_day" on snapshots/backups having "timestamp_format=short"
...
Snapshots and backups having no exact time information (created with
"timestamp_format=short") are set to 00:00, which would be regarded as
"previous day" if preserve_hour_of_day is greater than 0. Fix this by
ignoring preserve_hour_of_day in this case.
2018-04-05 18:00:29 +02:00
Axel Burri
c89ffd4213
btrbk: schedule: format preserve text only if needed
...
No functional changes, improves performance of schedule().
2018-04-05 18:00:24 +02:00
Thiodwitnir
5791d72171
btrbk: add "preserve_hour_of_day" configuration option
...
Introduces the new config option "preserve_hour_of_day" to specify
after what time backups should be considered as dailies.
Based on pull request #204 , with changes:
- calculation of weekly backups
- change format of preserve_matrix
2018-04-05 16:37:31 +02:00
Axel Burri
951ae256fa
btrbk: bump version to 0.27.0-dev
2018-04-05 16:26:57 +02:00
Axel Burri
1fd3a547df
change version to 0.26.1; bump copyright year
2018-03-05 11:55:56 +01:00
Axel Burri
821e8bba6a
add .gitattributes (export-ignore)
...
Effectively removes .gitignore files when using `git archive`.
2018-03-05 11:55:56 +01:00
Axel Burri
1cf004533c
documentation: replace subvolid=0 with subvolid=5
2018-03-05 11:33:08 +01:00
Axel Burri
6f38536052
btrbk: set c_default for config keys with computed default
...
Suppress "Option redefined" warning for snapshot_name config option,
which has hardcoded (computed) default already set when checking.
fix regression: 0ebe2ea2e1
2018-02-26 16:06:12 +01:00
Axel Burri
e75cf0c72c
btrbk: fix exit status and transaction log when archive_exclude is set
...
Similar to ABORTED=USER_SKIP (active commandline filter), archives
having ABORTED=ARCHIVE_EXCLUDE_SKIP (active archive_exclude
configuration) do not cause exit status 10 and are hidden from
transaction log.
2018-02-26 14:35:26 +01:00
Axel Burri
c0e0644eff
btrbk.conf.example: add stream_buffer command to example config
2018-02-14 00:25:58 +01:00
Axel Burri
5651c96e4e
btrbk: archive: always print "[-]" if no action was performed for target
2018-02-14 00:18:44 +01:00
Axel Burri
8610e75459
btrbk: add archive_exclude configuration option
...
Support wildcard characters, matches against both "$sroot->{PATH}" and
"$sroot->{PATH}/$snapshot_name".
2018-02-13 22:50:23 +01:00
Axel Burri
0ebe2ea2e1
btrbk: add "allow_multiple" flag for config_options declaration; use for option "group"
2018-02-13 19:30:24 +01:00
Axel Burri
3aaafa3d88
btrbk: add "meta" context for config defaults
...
Preparatory patch to allow multiple identical config keys in same
section.
2018-02-13 19:28:38 +01:00
Axel Burri
b2b43cf199
btrbk: add configurable error_statement for check functions
...
Corrects error messages from --exclude option.
Applies to in check_file(), check_url() and append_config_option().
2018-02-13 17:40:14 +01:00
Axel Burri
db1fe2d11a
btrbk: fix output of "btrbk list backups" and "btrbk stats" (match all uuid/received_uuid combinations)
2018-02-07 16:24:49 +01:00
Axel Burri
a835241ccf
documentation: btrbk.1.asciidoc: add note about listing all snapshots for "btrbk list snapshots"
2018-02-03 13:18:19 +01:00
Axel Burri
a3641cff74
btrbk: fix filter statement matching for volume="/"
...
While $vol->{URL} can contain "//" if volume="/" (intentionally, this
is an assembled path), the filter statements are sanitized using
check_url(). This means we need to match the filter statement against
check_url($vol->{URL}). Same applies to subvol.
2018-02-03 12:55:21 +01:00
Axel Burri
90fed6525e
btrbk: bugfix: restrict snapshot_dir and snapshot_create to root/volume/subvolume context
2018-01-31 19:01:00 +01:00
Axel Burri
753d68b2ed
btrbk: add documentation on caching in btr_tree()
2018-01-30 14:02:36 +01:00
Axel Burri
84bac59ab4
btrbk: fix parsing of "openssl_iv_size" configuration option
2018-01-21 18:53:29 +01:00
Axel Burri
308444f3ed
documentation: FAQ.md: add warning on "dd" usage for disk cloning
2018-01-20 18:05:33 +01:00
Axel Burri
b8e88f71a6
contrib: systemd: btrbk.service: add Documentation link to btrbk(1)
2017-10-24 13:29:06 +02:00
Axel Burri
57bc86b7a9
README.md: mention github source code repository
2017-10-13 14:02:50 +02:00
Axel Burri
fa5309ee81
README.md: change git clone URL from git:// to https://
...
For security reasons, using the git:// protocol is discouraged.
2017-10-13 13:51:10 +02:00
Axel Burri
13f37491ed
btrbk: cosmetics: change order of commands in help message
2017-10-12 17:08:46 +02:00
Axel Burri
659b7de82f
doc/btrbk.conf.5.asciidoc: fix spelling
2017-10-12 17:07:05 +02:00
Axel Burri
79cbf7c0c3
change version to 0.26.0
2017-10-12 00:39:06 +02:00
Axel Burri
c445b32459
doc/Makefile: use a2x --no-noxmllint for man page conversion
2017-10-12 00:39:06 +02:00
Axel Burri
780ef57895
documentation: remove experimental status of option "stream_buffer"
2017-10-11 20:54:41 +02:00
Axel Burri
909c68f164
btrbk: transaction_log and transaction_syslog are only allowed in root context
2017-10-11 20:54:41 +02:00
Axel Burri
d941ecfce9
documentation: change digint links to https://
2017-10-11 20:54:41 +02:00
Axel Burri
15dde32126
documentation: fix broken links
2017-10-11 20:54:41 +02:00
Axel Burri
fdba94f8c7
documentation: btrbk.1.asciidoc: add action command / result matrix
2017-10-11 20:54:41 +02:00
Axel Burri
c44c83bc33
Makefile: call doc/Makefile for installing files from "doc/" folder; use more variables
2017-10-11 20:54:41 +02:00
Axel Burri
c26b7d3748
doc/Makefile: generate man pages from asciidoc
2017-10-11 20:54:41 +02:00
Axel Burri
2042c6ccd9
documentation: ssh_filter_btrbk.1.asciidoc: use "ssh_filter_btrbk" (without ".sh") in name section, as this is used as the output filename for asciidoc
2017-10-11 20:54:41 +02:00
Axel Burri
c70e9bb757
documentation: ssh_filter_btrbk.1.asciidoc: cleanup
2017-10-11 20:54:41 +02:00
Axel Burri
0231051162
documentation: btrbk.1.asciidoc: cleanup
2017-10-11 20:54:26 +02:00
Axel Burri
3df8984337
documentation: btrbk.conf.5.asciidoc: change options subsections; cosmetics
2017-10-11 18:54:41 +02:00
Axel Burri
43399be0db
documentation: btrbk.conf.5.asciidoc: add short descriptions for target raw options
2017-10-11 18:05:51 +02:00
Axel Burri
c4ced9d6e4
documentation: convert all groff files (man pages) to asciidoc
...
- btrbk.conf.5 to btrbk.conf.5.asciidoc
- btrbk.1 to btrbk.1.asciidoc
- ssh_filter_btrbk.1 to ssh_filter_btrbk.1.asciidoc
2017-10-11 18:04:25 +02:00
Axel Burri
e3ee674085
btrbk: limit search depth to 256 when resolving ancestors
...
Note that the current implementation is not very optimized, we should
introduce a parent/child hash table for all queries in
get_latest_common().
2017-10-10 16:46:05 +02:00
Axel Burri
3be65b9f67
btrbk: resolve ancestors (recursive on parent_uuid chain) when searching for latest common subvolume
2017-10-10 13:10:33 +02:00
Axel Burri
0799820556
btrbk: support btrfs-progs 4.13.2: adapt parsing of "btrfs subvolume list"
...
btrfs-progs v4.13.2 changed the output of "btrfs subvolume list", in
order to make the tabular output format look nicer (?!?):
e4c6772f69
2017-10-09 23:04:07 +02:00
Axel Burri
e9a517f161
btrbk: add options "{snapshot,target,archive}_qgroup_destroy": destroy qgroups whenever a subvolume is deleted
...
Btrfs does not destroy qgroups when subvolumes are deleted (see
https://bugzilla.kernel.org/show_bug.cgi?id=91751 ). As a workaround
for this, btrbk can be configured to always destroy the corresponding
default qgroup "0/<subvol-id>" whenever a subvolume (snapshot, backup
or archive) is deleted.
Added configuration options:
- snapshot_qgroup_destroy
- target_qgroup_destroy
- archive_qgroup_destroy
2017-10-02 16:23:23 +02:00
Axel Burri
6cb98700d8
btrbk: allow archive_preserve_* options in root context only
2017-10-02 13:54:37 +02:00
Axel Burri
a5aaffa5b5
documentation: add "prune" to list of affected commands by several options
2017-10-02 13:44:35 +02:00
Axel Burri
2e974c1f4f
btrbk: add "--wipe" command line option
2017-09-28 14:17:00 +02:00
Axel Burri
5bdc3e527b
btrbk: add "prune" command
2017-09-28 14:17:00 +02:00
Axel Burri
2809dc54c5
btrbk: remove sorting of deleted subvolumes in summary (not needed anymore)
...
Deleted subvolumes are already sorted by schedule().
Sorting by PATH is bad anyways, as it does not sort _NN postfix
correctly.
2017-09-28 14:17:00 +02:00
Axel Burri
512aca5332
btrbk: parse output of "btrfs subvolume delete"
...
When doing a batch delete (multiple deletes with one call to "btrfs
subvolume delete"), we want to know which subvolumes have failed. For
this, we need parse the error output.
On any parsing failure, we assume that nothing has been deleted, and
warn accordingly (forward compatibility).
2017-09-28 14:17:00 +02:00
Axel Burri
9d9527ca9a
btrbk: simplify transaction function calls
...
Prefix transaction status with "dryrun_" in start_transaction() /
end_transaction if $dryrun is set.
2017-09-28 14:17:00 +02:00
Axel Burri
422d52c063
btrbk: add key derivation for encrypted raw targets using external backend
2017-09-28 14:17:00 +02:00
Axel Burri
de7628ac7c
btrbk: add openssl_enc encryption for raw targets; add system_urandom()
...
Example:
Manually create a key:
# KEYFILE=/some/secure/place/btrbk.key
# dd if=/dev/urandom bs=1 count=32 | od -x -A n | tr -d "[:space:]" > $KEYFILE
btrbk.conf:
volume /mnt/btr_pool
incremental no
raw_target_encrypt openssl_enc
openssl_ciphername aes-256-cbc
openssl_iv_size 16 # NOTE: set to "no" if no IV is needed by the selected cipher
openssl_keyfile /some/secure/place/btrbk.key
subvolume home
target raw ssh://cloud.example.com/backup
2017-09-28 14:17:00 +02:00
Axel Burri
251c2fb2a1
btrbk: re-enable parsing of deprecated raw file format (uuid suffix)
2017-09-28 14:17:00 +02:00
Axel Burri
e804930b5e
btrbk: allow deletion of non-incremental raw targets
...
implemented directly in btrfs_subvolume_delete()
2017-09-28 14:17:00 +02:00
Axel Burri
dcb0c5aa28
contrib/migration/raw_suffix2sidecar: add migration tool for creating raw sidecar files from uuid-suffixed raw backup files
2017-09-28 14:17:00 +02:00
Axel Burri
cd8d7e3a0a
btrbk: use sidecar file "*.info" instead of encoding uuids into filename for raw targets
...
pros:
- better forward compatibility, e.g. symmetrical encryption
- better readability of files
cons:
- two files per backup
2017-09-28 14:16:53 +02:00
Axel Burri
571dae4428
btrbk: do not run in perl taint mode by default: remove "perl -T" in hashbang; hardcode $PATH only if taint mode is enabled
...
While taint mode [1] is a nice feature of perl, e.g. it disallows
using variables (such as filenames from the config file) which were
not validated in system() commands, it also treats $PATH as insecure
(which inherently is, as perl cannot know who messed around with it).
[1] perlsec(1): http://perldoc.perl.org/perlsec.html
[2] perlrun(1): http://perldoc.perl.org/perlrun.html
Note that btrbk still does all taint checks, and can be run in taint
mode:
- by executing `perl -T /usr/sbin/btrbk`,
- or by changing the hashbang to: `!#/usr/bin/perl -T`.
2017-09-25 17:53:35 +02:00
Axel Burri
5f867c2347
btrbk: run_cmd(): catch all possible errors when executing system command
2017-09-25 15:00:40 +02:00
Axel Burri
e402435dc8
btrbk: treat deprecated warnings as non-fatal
...
Despite FATAL warnings are discouraged in perl and may break forward
compatibility [1], we still use it as btrbk is usually run as root and
we really want perl to die on programmatic errors.
[1] "perldoc warnings"
2017-09-25 15:00:40 +02:00
Enno Boland
62fad0e326
documentation: README.md: mention installation on VoidLinux
2017-09-21 13:49:02 +02:00
Axel Burri
6c2d56d621
btrbk: action "clean": dont list failed deletes in summary
2017-09-21 12:39:48 +02:00
Axel Burri
b8a8bc917d
documentation: FAQ.md: fix description for removing received_uuid on read-only subvolume
2017-09-11 19:37:09 +02:00
Axel Burri
f113436626
btrbk: bugfix: check path when expanding wildcards (warn and ignore if check fails)
...
Before this patch, btrbk errored (unsafe command), and then died.
Fixes #181 .
2017-09-11 18:49:14 +02:00
boerwastaken
d265c34149
btrbk: make SSH minimally chatty (always add '-q' option)
...
Fixes digint/btrbk#179 : When SSH is chatty (informing of host key
rollover etc) the remote command output parser borks.
2017-09-04 13:00:19 +02:00
Axel Burri
8eb88a8681
documentation: replace POD header with comments
2017-08-28 20:33:00 +02:00
Axel Burri
88aa8c1fea
btrbk: remove "duration" column from transaction_log/transaction_syslog
...
The "duration" column in the transaction log has proven to be
confusing to some users, especially on errors (e.g. "send-receive
ERROR 27" in issue #177 ). As it's not really necessary (duration can
be computed from the corresponding "starting" log entry), it's now
being dropped.
2017-08-28 17:55:27 +02:00
Axel Burri
6acea6a08d
btrbk: bugfix: print correct time in end_transaction()
2017-08-28 17:54:17 +02:00
Axel Burri
b1f3936826
ssh_filter_btrbk: bugfix: use "lzop" instead of "lzo" for lzo compression command
2017-08-21 14:42:01 +02:00
Axel Burri
ee17c1a2b4
ssh_filter_btrbk: accept mbuffer command (stream_compress)
2017-08-21 14:39:40 +02:00
Axel Burri
5428e9cd93
btrbk: add "resume" and "snapshot" commands; add --preserve-snapshots and --preserve-backups options; deprecate "-r, --resume-only" command line option
2017-08-21 13:23:20 +02:00
Axel Burri
a9f1b6b24a
change version to 0.25.1
2017-07-30 16:03:58 +02:00
Axel Burri
6cf5d59644
btrbk: add support for btrfs-progs 4.12: do not fail or set realpath_cache for relative paths in btrfs_subvolume_show()
...
As of btrfs-progs-v4.12, the "btrfs subvolume show" command does not
print the full (absolute, resolved) path anymore [1]. Instead, it prints
the relative path to btrfs root (or "/" if it is the root).
The impact for btrbk is that we cannot fill our realpath_cache in
btrfs_subvolume_show() anymore. This is not fatal, but has the
following consequences:
- The "check for duplicate snapshot locations" may now miss
subvolumes specified by symlinks.
- If multiple "volume" sections point to the same subvolume (e.g. if
specified using symlinks) an additional "btrfs subvolume list" is
called. Note that the subvolume will still be recognized as
identical, and the btr_tree will not be rebuilt.
[1] btrfs-progs commit: b7df24aa5cddc4802b9938f56372b73869775cd9
2017-07-30 15:25:32 +02:00
Axel Burri
26682213e2
btrbk: cleanup btrfs_subvolume_list() and comments
2017-07-30 15:03:23 +02:00
Axel Burri
7b50846957
documentation: add more instructions for faulty received_uuid
2017-07-29 20:54:43 +02:00
Axel Burri
356231bc2a
btrbk: abort if source subvolume has readonly or received_uuid flag
2017-07-29 19:03:23 +02:00
Michael Goodwin
59cc728d90
documentation: README.md: add fedora instructions and pv prereq
2017-07-21 14:00:49 +02:00
Axel Burri
b891617086
documentation: add donate section (paypal) in README.md
2017-07-13 12:54:08 +02:00
Michael Goodwin
c5ea0c5c71
Makefile: Preserve timestamps with install -p
2017-07-05 14:02:44 -04:00
Axel Burri
83a38cb390
documentation: FAQ.md: add section "How can I setup a debian pre-install-hook?"
2017-06-25 21:23:55 +02:00
Axel Burri
c0c546eb4e
btrbk: stats command: show "correlated" status instead of "orphaned" (inverse logic which caused a lot of confusion)
2017-06-25 21:16:08 +02:00
Axel Burri
15bae5e051
btrbk: stats command: print up-to-date status on backups
2017-06-25 21:14:03 +02:00
Axel Burri
b2cc99b0fb
btrbk: bugfix: accept "no" for "transaction_log", "transaction_syslog" and "lockfile" configuration options
2017-06-25 18:06:06 +02:00
Axel Burri
315b3f24a1
btrbk: add config option "stream_buffer <size>". if set, pipes send stream through "mbuffer -m <size>"
2017-06-08 12:35:22 +02:00
Axel Burri
401b4ac45c
documentation: README.md: add warning about using `btrfs property set` when restoring backups
2017-05-08 14:28:17 +02:00
Cerem Cem ASLAN
ed80bccc79
documentation: README.md: minor fixes in example
2017-04-29 21:37:39 +02:00
Cerem Cem ASLAN
b58817d5af
documentation: FAQ.md: improved "changing root subvolume" section
...
Fixed the default subvolume ID from 0 to 5. Added some tips.
2017-04-29 21:06:18 +02:00
Santiago Castro
b4ec8d32a5
Fix broken Markdown headings
2017-04-17 22:52:07 -03:00
Bladtman242
4f05bb78f0
Update README.md
...
Under "Example: laptop with usb-disk for backups" the readme stated that " snapshot_preserve 14d" will "keep daily snapshots for 14 days [..]". I believe that this is misleading, as it seems to imply that only one snapshot --the latest -- will be kept in that period, when in fact _all_ snapshots will be kept in that period.
2017-03-30 22:34:48 +02:00
Axel Burri
7436d9432c
change version to 0.25.0
2017-03-18 16:53:07 +01:00
Axel Burri
d31ffb8cb0
btrbk: allow trailing comments in btrbk.conf
2017-03-18 16:34:53 +01:00
Axel Burri
358a2b1169
btrbk: cleanup: btrfs_send_to_file() takes no more additional options (all info is fetched directly from source/target config)
2017-03-18 15:06:48 +01:00
Axel Burri
28c65e4675
btrbk: add raw_target_split option, using "split" instead of "dd" to write raw files
2017-03-18 14:47:43 +01:00
Axel Burri
84e5b6243b
documentation: cosmetics: fix typos
2017-03-18 12:19:07 +01:00
Axel Burri
690a8158ed
ssh_filter_btrbk: always allow pipes through compression commands
2017-03-18 12:19:07 +01:00
Axel Burri
da70158c24
ssh_filter_btrbk: correctly handle --sudo option
2017-03-18 12:19:07 +01:00
Axel Burri
3b7ede773a
btrbk: bugfix: make sure rate limiting comes after compression in cmd_pipe
2017-03-18 12:18:47 +01:00
Axel Burri
a7f52785bd
documentation: add all accepted facility names for transaction_syslog
2017-02-18 13:16:43 +01:00
Axel Burri
cb82bd5fa4
btrbk: add supoort for "backend btrfs-progs-sudo" option; adaptions in ssh_filter_btrbk.sh
2017-01-04 15:04:22 +01:00
Ian Kelling
d02f67a924
btrbk: get_receive_targets: also match "src.received_uuid == target.uuid"
...
This gets important when using an old backup disk as source.
In terms of btrfs send/receive, all subvolumes matching "uuid /
received_uuid" are valid backups.
Merged (amend) from pull request: #116
Verified by Axel Burri <axel@tty0.ch>
2017-01-04 12:41:05 +01:00
Axel Burri
2acbe4978e
documentation: cosmetics: fix spelling
2017-01-03 13:42:38 +01:00
Axel Burri
79637de5aa
btrbk: raw_target_encrypt: always set "gpg --no-random-seed-file": prevents creation of "~/.gnupg/random_seed" with slight perfomance penalty.
...
We set "--no-random-seed-file" because one of the btrbk
design principles is to not create any files unasked. Enabling
"--no-random-seed-file" creates ~/.gnupg/random_seed, and as
such depends on $HOME to be set correctly (think on running in
cron). From gpg2(1) man page:
--no-random-seed-file GnuPG uses a file to store its
internal random pool over invocations This makes random
generation faster; however sometimes write operations are not
desired. This option can be used to achieve that with the cost
of slower random generation.
2017-01-03 13:41:39 +01:00
Axel Burri
b69e9ebf34
btrbk: show aggregate "size" and "used" for "usage" action
2016-12-11 15:36:48 +01:00
Axel Burri
da849b37ae
change version to 0.24.0
2016-11-16 15:32:17 +01:00
Axel Burri
ff8815b235
Documentation: btrbk.conf.5: add link to https://github.com/digint/btrfs-progs-btrbk in description of "backend" feature
2016-11-16 15:31:16 +01:00
Axel Burri
ec63e9932b
btrbk: support for btrfs-progs v4.8.3
...
Fix parsing of "btrfs sub show" output, which has changed for toplevel
subvolume.
2016-11-16 15:02:49 +01:00
Matt Christian
8432e1b9be
Makefile: Add -f option to all gzip commands
...
Always overwrite destination .gz files during make install.
Otherwise you need to manually answer y to several prompts.
```gzip: /usr/share/doc/btrbk/README.md.gz already exists; do you wish to overwrite (y or n)? y```
2016-11-16 14:10:50 +01:00
Axel Burri
57be688f6b
btrbk: bugfix: fix "list latest" with no snapshots
2016-11-12 13:21:33 +01:00
Axel Burri
b6defaa37f
documentation: add missing documentation of archive_preserve options
2016-08-29 19:44:17 +02:00
Axel Burri
a8a311c8c7
btrbk: add "backend" configuration option: support for distinct binaries from btrfs-progs-btrbk
...
btrfs-progs-btrbk sources (fork of btrfs-progs) can be found at:
https://github.com/digint/btrfs-progs-btrbk
2016-08-29 18:40:42 +02:00
Axel Burri
dc5dee3121
btrbk: use loglevel trace (instead of debug) for repeated WARN_ONCE
2016-08-29 15:03:56 +02:00
Axel Burri
1aa208151b
btrbk: improve check_file(): sanitize only on demand
2016-08-29 15:03:20 +02:00
Axel Burri
4c4afe776d
btrbk: skip target metadata test if send/receive has errors
2016-08-29 15:03:11 +02:00
Axel Burri
961f96833a
btrbk: use "dd" for raw target output, with configurable block size (raw_target_block_size)
...
We use "dd" instead of shell redirections, as it is common to have
special filesystems (like NFS, SMB, FUSE) mounted on the raw target
path. By using "dd" we make sure to write in reasonably large blocks
(default=128K), which is not always the case when using redirections
(e.g. "gpg > outfile" writes in 8K blocks).
Another approach would be to always pipe through "cat", which uses
st_blksize from fstat(2) (with a minimum of 128K) to determine the
block size.
2016-08-25 13:14:01 +02:00
Axel Burri
3dabb507e6
btrbk: do not set "--compress-algo none" on gpg command if raw_target_compress=no
...
Note that gpg might still compress (according to OpenPGP standard) if
--compress-algo is not set. This is generally a good thing.
2016-08-25 12:53:12 +02:00
Axel Burri
b0feaf4413
btrbk: force disabling of ssh compression (ssh -o compression=no) if stream_compress is set
2016-08-25 12:53:12 +02:00
Axel Burri
b49ee61ecd
btrbk: run_cmd: cosmetics
2016-08-25 12:53:12 +02:00
Axel Burri
5f530e47e5
btrbk: run_cmd: only perform sanity checks on files (hardcoded parts are considered safe)
2016-08-25 12:53:06 +02:00
Axel Burri
96f0d4c175
btrbk: fix and cleanup stream compression
2016-08-24 15:25:48 +02:00
Axel Burri
8f7d3e3c3d
ssh_filter_btrbk: bugfix: use eval when running $SSH_ORIGINAL_COMMAND (does not faile with pipes)
2016-08-21 11:51:55 +02:00
Axel Burri
13d27c8616
btrbk: perform extra metadata check on target subvolume after "btrfs receive"
...
Eliminates error cases where "btrfs receive" input is null, at the
cost of an additional call to "btrfs subvolume show".
2016-08-19 17:41:03 +02:00
Axel Burri
deeb12c069
ssh_filter_btrbk: allow stream compression if --compress option is set.
2016-08-19 17:36:40 +02:00
Axel Burri
9913e2785a
documentation: add stream_compress documentation, update Changelog
2016-08-19 17:36:33 +02:00
Axel Burri
13887837b1
btrbk: add lz4 compression
2016-08-19 16:58:53 +02:00
Axel Burri
3845fa5ec5
btrbk: use format from %compression hash in $raw_postfix_match
2016-08-19 16:58:53 +02:00
Axel Burri
05c54a2390
btrbk: add compression options: pigz, pbzip2, lzo
2016-08-19 16:58:53 +02:00
Axel Burri
a019d8a3e3
btrbk: add configuration option "stream_compress"
...
- add sophisticated stream compression in run_cmd
- add special "compress" cmd_pipe item
- add special "redirect" cmd_pipe item:
use shell redirection instead of troublesome "dd of=".
- disable ssh_compression if stream_compression is set
2016-08-19 16:56:38 +02:00
Axel Burri
99ff88f82a
btrbk: use (and propagate) CONFIG in vinfo instead of hard-setting RSH
2016-08-19 16:54:49 +02:00
Axel Burri
079b947cd6
btrbk: add function WARN_ONCE
2016-08-19 16:48:45 +02:00
TZdyrski
edffbd4af9
ssh_filter_btrbk: update ssh_filter_btrbk.sh to use readlink
...
bugfix for: 796b6bd9bf
Replace realpath with readlink in allowed commands. Commit 796b6bd
substituted readlink for realpath in file "btrbk"; this commit propagates the change to ssh_filter_btrbk.sh.
2016-08-19 01:05:02 +02:00
Axel Burri
708444b096
btrbk-mail, README.md: suggest using "rsync --inplace"
...
When used without --inplace, rsync creates a new copy of the file and
moves it into place when it is complete, having the effect that btrfs
creates a new extent for the WHOLE file. With --inplace however, rsync
writes the updated data directly to the destination file, having the
effect that btrfs creates a new extent only for the differing part of
the file.
2016-08-17 14:49:27 +02:00
Tobias Grosser
84a5c56a83
btrbk: disable compression in gpg
...
We already perform compression before gpg, such that compressing in gpg
is just a waste of time. Interestingly, it seems gpg is not trying to
recompress gzip[ed] input streams, as for the default gzip compression
this patch does not change performance. However, it is necessary for
the upcoming lz4 compression to show its real benefit.
2016-08-07 13:40:45 +02:00
Axel Burri
66c36187ed
documentation: README.md: remove link to digint-overlay, btrbk is in portage now
2016-07-14 14:19:09 +02:00
Axel Burri
e9a72cf097
documentation: README.md: cosmetics
2016-07-14 14:19:08 +02:00
Axel Burri
9a5e8311be
change version to 0.23.3
2016-07-14 01:41:45 +02:00
Asbjørn Apeland
16d73b4e5a
Makefile: support .in files (use to replace @BINDIR@ in btrbk.service)
2016-07-13 20:56:28 +02:00
Axel Burri
3f2e53ba71
Makefile: compress ChangeLog in install-doc
2016-07-13 20:56:19 +02:00
Craig Andrews
16d8fe36a1
Makefile: include ChangeLog in install-doc
...
install-doc should install ChangeLog along with the other documentation.
2016-07-13 19:09:05 +02:00
Axel Burri
796b6bd9bf
btrbk: replace "realpath -e" with "readlink -e" for mountpoint discovery
2016-06-18 13:04:43 +02:00
Axel Burri
91d02ca97b
change version to 0.23.2
2016-06-07 16:41:41 +02:00
Axel Burri
3a8665bce9
documentation: add information about wildcard characters for subvolume section; cleanup
2016-06-07 16:37:32 +02:00
Axel Burri
e4a7ba4be5
btrbk: add lockfile support, using perl "flock": add configuration option "lockfile <file>", and command line option "--lockfile"'
2016-06-07 16:17:02 +02:00
Axel Burri
6532229361
documentation: FAQ.md: recent versions of btrfs-progs print "is toplevel subvolume" instead of "is btrfs root"
2016-05-30 13:20:47 +02:00
Axel Burri
36edda5123
documentation: replace wrong "target_min" with "target_preserve_min" in example config
2016-05-30 13:19:07 +02:00
Axel Burri
7326b9816c
btrbk: bugfix: raw targets: correctly handle multiple backups in same target directory
2016-05-09 12:42:04 +02:00
Axel Burri
eabdba482e
btrbk-mail: Use relative instead of absolute calls to system binaries
...
Make sure to have apropriate PATH set when calling btrbk-mail.
Usually specified in /etc/crontab, and should be correct by default on
all distros.
2016-05-09 12:13:22 +02:00
Benedikt Morbach
df7473f7df
Makefile: respect BINDIR in systemd service
2016-05-09 12:03:59 +02:00
Axel Burri
cb0851c8b6
change version to 0.23.1
2016-05-03 16:21:34 +02:00
Axel Burri
65ebf949d1
documentation: cosmetics: groff: consistently use minus "\-" instead of hyphen "-" where applicable
2016-05-03 16:01:39 +02:00
Axel Burri
cb6dcbe58e
documentation: cosmetics (no more long lines)
2016-05-03 15:30:06 +02:00
Axel Burri
5cd03a8fbf
btrbk: remove absolute path to executables, this caused trouble on some distros
2016-05-03 14:34:04 +02:00
Axel Burri
54b5368309
btrbk: code cleanup (remove unneeded code, rename vars)
2016-05-03 13:19:42 +02:00
Axel Burri
12d435d42a
btrbk: explain "orphaned" status in "stats" command, and suppress it on "list backups" command
2016-04-30 13:01:12 +02:00
Axel Burri
46f1e5e2e4
btrbk: only load Data::Dumper if needed (log level "trace", or development version); cosmetics
2016-04-28 13:03:15 +02:00
Axel Burri
49ae46d51d
btrbk: do not print headers to transaction_log, these are documented in btrbk.conf(5)
2016-04-28 12:51:00 +02:00
Axel Burri
e9e398af37
Merge branch 'syslog'
2016-04-28 12:45:13 +02:00
Axel Burri
7a469597ac
documentation: describe transaction log table format; cosmetics
2016-04-28 12:44:33 +02:00
Axel Burri
7e7c28f8f1
btrbk: add eval_quiet(), a simple wrapper around eval, disabling $SIG_(__DIE__)
2016-04-28 12:43:32 +02:00
Axel Burri
082754173c
btrbk: bugfix: raw targets: do not inject child if add_btrbk_filename_info() failed
2016-04-25 21:12:33 +02:00
Axel Burri
47eb14f5fb
btrbk: syslog: add syslog hack in print_formatted(); remove print-to-scalar hack
2016-04-25 19:40:11 +02:00
Axel Burri
c424d917b6
btrbk: syslog: only load Sys::Syslog module if configuration option is set; soft-fail on syslog calls
2016-04-25 18:36:54 +02:00
Hans van Kranenburg
59d96420c8
btrbk: add transaction logging to syslog
...
Add configuration option transaction_syslog, which can be set to a short
name of a syslog facility, like user or local5. Most of the ones besides
localX do not really make sense, but whatever, let the user decide.
The only logging that is relevant for logging to syslog is the logging
generated inside sub action, so it's easy to hijack all messages in
there and also send them to syslog if needed.
All output is done via print_formatted, which expects a file handle.
So, abuse a file handle to a string to be able to change as less code as
needed for this feature.
Since syslog already adds the timestamps for us, I added a syslog
formatting pattern, which is very similar to tlog, omitting the
timestap.
2016-04-25 17:32:08 +02:00
Axel Burri
81feb41619
ssh_filter_btrbk: allow access to "/" if no path restrictions are set.
2016-04-25 16:58:56 +02:00
Axel Burri
89df601ee5
btrbk: allow "<hostname>:<path>" notation for volume and target sections
2016-04-25 16:34:52 +02:00
Axel Burri
702ee8950e
btrbk: bugfix: vinfo(): correctly parse url, using check_url()
2016-04-25 15:10:00 +02:00
Axel Burri
357b72bd3f
btrbk: code cleanup: check_file() and check_url() do all the sanitize parts
2016-04-25 14:23:15 +02:00
Axel Burri
191284cd43
btrbk: bugfix: set correct parent section when propagating targets
2016-04-24 15:59:17 +02:00
Axel Burri
4ffaf430c5
change version to 0.23.0
2016-04-23 15:06:57 +02:00
Axel Burri
b4c4a96b14
Makefile: add doc/upgrade_to_v0.23.0.md
2016-04-23 15:04:45 +02:00
Axel Burri
2e8e4ddefc
btrbk: cosmetics: change info log of send/receive; change topic line; fix typos
2016-04-23 14:58:08 +02:00
Axel Burri
efc260ef91
btrbk: add sanity check on timezone offset; add documentation about implications of long-iso time format
2016-04-23 14:49:12 +02:00
Axel Burri
c7dd680537
btrbk: make sure that snapshots/backups with date in the future are never deleted
2016-04-22 20:51:31 +02:00
Axel Burri
ecb2307b22
btrbk: send/receive: only inject child if target creation was successful
2016-04-22 20:25:30 +02:00
Axel Burri
3ffa63daba
btrbk: bugfix: btrfs_subvolume_show(): quote real_path everywhere
2016-04-22 20:17:26 +02:00
Axel Burri
c13c99ada5
btrbk: add new time_format "long-iso", with seconds and timezone offset (iso8601 format); add function timestamp(): remove dependency to POSIX
2016-04-22 19:47:01 +02:00
Axel Burri
e824c21f50
btrbk: use build-in Time::Local in combination with localtime() instead of Date::Calc; correctly calculate leap hours
2016-04-20 22:45:11 +02:00
Axel Burri
c73dffbd25
btrbk: handle missing Data::Dumper gracefully
2016-04-19 22:12:08 +02:00
Axel Burri
829490f963
btrbk: put btrbk filename info directly to tree node (parse only once)
...
performance win: factor 2.3
2016-04-19 22:04:07 +02:00
Axel Burri
c225231742
btrbk: reuse subvol list for get_receive_targets()
...
performance win: factor 2.6 !
2016-04-19 22:01:23 +02:00
Axel Burri
2b22524ccd
btrbk: sane defaults: xxx_preserve_min defaults to "all", xxx_preserve default to "no" (for backwards compatibility with 0.22.0 default)
2016-04-19 21:37:04 +02:00
Axel Burri
29b9c8fc60
btrbk: action "archive": abort if receive targets of archive candidates exist at unexpected location. makes sure we dont have duplicates on our archives
2016-04-19 21:02:51 +02:00
Axel Burri
5e7a6e5ef4
btrbk: action "archive": delete archives according to archive retention policy
2016-04-19 21:02:51 +02:00
Axel Burri
31f0f97ff0
btrbk: fix info logging for send/receive
2016-04-19 21:02:51 +02:00
Axel Burri
7807fface8
btrbk: cosmetics; s/config_override_opts/config_override_cmdline/g
2016-04-19 21:02:51 +02:00
Axel Burri
2c3997ad0a
btrbk: bugfix: action "config print": correctly handle undef options; skip deprecated options
2016-04-19 21:02:47 +02:00
Axel Burri
2317580639
documentation: README.md: add update notice (v0.22.2 -> v0.23.0)
2016-04-18 00:16:45 +02:00
Axel Burri
a27f99af46
change version to 0.23.0-rc1
2016-04-17 21:46:56 +02:00
Axel Burri
bbb18f5af7
btrbk: cosmetics on info warnings
2016-04-17 21:46:53 +02:00
Axel Burri
edfebb8193
btrbk: action "origin": use --format options; do not recurse into parent chain
2016-04-16 22:05:26 +02:00
Axel Burri
1151d2c572
btrbk: print_formatted(): honor use_header argument for all table formats
2016-04-16 20:25:22 +02:00
Axel Burri
9afe17f738
btrbk: continue gracefully (skip instead of abort) when resuming subvolume having existing (possibly garbled) target; cosmetics on debug/trace log
2016-04-16 19:31:29 +02:00
Axel Burri
ec9dd761b8
btrbk: use "[subvol cmd]" instead of "[btrfs cmd]", and print this as info log
2016-04-16 18:06:55 +02:00
Axel Burri
59b3cde303
Merge branch 'action_archive' into devel
2016-04-16 17:32:07 +02:00
Axel Burri
689d3d1233
btrbk: action "archive": print created subdirectories on summary; cleanup
2016-04-16 17:31:14 +02:00
Axel Burri
5a06a85619
btrbk: moved get_receive_targets_fsroot() out of get_receive_targets(), while cleaning up
2016-04-16 17:25:53 +02:00
Axel Burri
774e6ef842
btrbk: macro_archive_target(): only warn on unexpected targets, not abort
2016-04-16 17:25:53 +02:00
Axel Burri
de05b99757
btrbk: rename action "clone" to "archive" (should have been like this from the beginning)
2016-04-16 17:25:51 +02:00
Axel Burri
4bd68a2e35
btrbk: action "clone": abort all as soon as one target aborts
2016-04-16 00:45:16 +02:00
Axel Burri
cc20dfb8c3
btrbk: schedule(): use "informative_only" option instead of checking for empty value; make sure real values are always in front
2016-04-15 23:29:47 +02:00
Axel Burri
d0cfba7914
btrbk: action "clone": create missing directories
2016-04-15 23:29:47 +02:00
Axel Burri
a5c7c53a86
btrbk: action "clone": print scheduler results if --print-schedule option is set
2016-04-15 23:29:47 +02:00
Axel Burri
14de16aabe
btrbk: add action "clone": recursively send/receive all backups to an archive directory
2016-04-15 23:29:47 +02:00
Axel Burri
3c9aff4c40
btrbk: enable --override option
2016-04-15 11:10:12 +02:00
Axel Burri
e3702305e6
btrbk: bugfix: update uuid_cache after btrfs_subvolume_show()
2016-04-15 11:07:26 +02:00
Axel Burri
6e997674fc
btrbk: remove "btrfs_progs_compat" configuration option, from now on we REQUIRE btrfs-progs >= v3.18.2: we rely on received_uuid for most operations
2016-04-15 11:07:16 +02:00
Axel Burri
6aa54b2dd5
btrbk: bugfix: correctly handle NODE_SUBDIR in vinfo_inject_child()
2016-04-14 18:24:11 +02:00
Axel Burri
141b70f26b
btrbk: bugfix for subdir resolving: on older kernels, the "subvolid" mount option is not shown: try to read it with btrfs_subvolume_show()
2016-04-14 18:21:00 +02:00
Axel Burri
a1ee9d5c6d
btrbk: allow "{snapshot,target}_preserve no": disable retention policy
2016-04-14 14:43:43 +02:00
Axel Burri
a03c515b0a
btrbk: enter failsafe mode on deprecated preserve configuration: at least create the snapshots, and print message to read the upgrade documentation
2016-04-14 13:41:53 +02:00
Axel Burri
73906caacd
documentation: update/fix ChangeLog, README.md, btrbk.conf.5; add "doc/upgrade_to_v0.23.0.md"
2016-04-13 22:05:20 +02:00
Axel Burri
be608a04b2
documentation: btrbk.conf.example: adaptions for new {snapshot,target}_preserve options
2016-04-13 22:05:20 +02:00
Axel Burri
7c0987bd3c
btrbk: be harsh (abort) on deprecated "{snapshot,target}_preserve_{daily,weekly,monthly}" and "resume_missing no" options; change default of snapshot_preserve_min to one day
2016-04-13 22:05:20 +02:00
Axel Burri
36cc96fdb8
btrbk: always preserve latest snapshot/backup pair (instead of latest snapshot and latest backup); remove preserve_latest option of schedule()
2016-04-13 22:05:20 +02:00
Axel Burri
032642751b
btrbk: change preserve table text: print latest match instead of earliest match
2016-04-13 22:05:20 +02:00
Axel Burri
e200975f32
btrbk: add option "*preserve_min latest"; deny "snapshot_preserve_min no"
2016-04-13 22:05:20 +02:00
Axel Burri
d143d75b43
btrbk: rename *preserve_all to *preserve_min
2016-04-13 22:05:20 +02:00
Axel Burri
55b121c372
btrbk: remove resume_missing configuration option
2016-04-13 22:05:20 +02:00
Axel Burri
738178565c
btrbk: fix vinfo_inject_child() for raw targets
2016-04-13 22:05:20 +02:00
Axel Burri
a76512955a
btrbk: add vinfo_inject_child(): add a custom node to btr_tree, with fake id, uuid, gen and cgen; use to inject created snapshots and receive targets
2016-04-13 17:17:23 +02:00
Axel Burri
bd34d9f689
btrbk: change preserve logic: keep FIRST present of hour/day/... instead of LAST
2016-04-13 17:17:14 +02:00
Axel Burri
6b07316fef
documentation: README.md: use new preserve semantics in examples
2016-04-12 12:07:33 +02:00
Axel Burri
7a334097c1
btrbk: cosmetics (logging and summary text about -p option)
2016-04-12 11:47:41 +02:00
Axel Burri
1e91f179d4
documentation: btrbk.1: update sections containing infos about retention policy; fix documentation of -p option; cosmetics
2016-04-12 11:47:41 +02:00
Axel Burri
326edfcc29
btrbk: change preserve semantics (incompatible):
...
- add "{snapshot,target}_preserve_all" configuration option
- change semantics of "{snapshot,target}_preserve NNd" to "preserve
latest daily only"
- change default of "preserve daily,monthly" to 0 (was: all)
- add deprecated warning and enter compatibility mode: preserve
everything if deprecated {snapshot,target}_preserve_* options are
encountered
2016-04-12 11:47:28 +02:00
Axel Burri
ceb4dbf19c
btrbk: add --print-schedule command line option
2016-04-09 14:16:14 +02:00
Axel Burri
78bfc5b885
btrbk: bugfix: use "/bin/false" as RSH if no config is available
2016-04-08 13:38:50 +02:00
Axel Burri
ccc2a35520
ChangeLog: update missing items
2016-04-07 15:53:50 +02:00
Axel Burri
a887e89732
btrbk: warn on receive targets at unexpected location (whole filesystem) when resuming missing backups (do not abort anymore);
2016-04-07 14:35:27 +02:00
Axel Burri
6b71b68fcb
btrbk: bugfix: do not run "rm" command with no arguments (on raw targets)
2016-04-06 20:41:36 +02:00
Axel Burri
5d65748ffe
btrbk: call init_transaction_log() at the beginning of every action, instead at global place
2016-04-06 20:27:27 +02:00
Axel Burri
211964f709
btrbk: parse btrbk_basename and btrbk_date in vinfo_child() instead of vinfo_subvol_list()
2016-04-06 20:24:56 +02:00
Axel Burri
bfb556757d
btrbk: get_latest_common(): use all brothers (snapshots with same parent) as candidates (older first, then newer) instead of only older; as last resort, use subvolumes in snapshot_dir matching btrbk file name scheme as candidates
2016-04-06 15:36:54 +02:00
Axel Burri
46e3aae857
btrbk: get_latest_common(): add strategy to find latest common for readonly and received subvolumes; add helper function cmp_date()
2016-04-06 15:36:51 +02:00
Axel Burri
a26e8851b4
btrbk: btr_tree: return already assembled tree if a subvolume is already known in uuid_cache
2016-04-06 15:36:27 +02:00
Axel Burri
ac0002bce8
btrbk: get_receive_targets() also returns matching source_received_uuid
2016-04-06 15:36:27 +02:00
Axel Burri
4b1983378f
btrbk: add useful flags and parse date and basename of btrbk created files in vinfo_subvol_list(); replace parse_filename() calls by usage of new flags
2016-04-06 13:35:37 +02:00
Axel Burri
0bfb78b842
btrbk: remove trailing slash from NODE_SUBDIR
2016-04-03 21:41:41 +02:00
Axel Burri
899ca92026
btrbk: bugfix: untaint raw backup file list read by "find" command
2016-04-03 21:38:19 +02:00
Axel Burri
023004e9cc
btrbk: bugfix: add '=' character to (regression introduced in a7cd4a99
)
2016-04-03 21:09:30 +02:00
Axel Burri
ea5cd06fbc
btrbk: bugfix: get_receive_targets() for BTRFS_PROGS_COMPAT (regression introduced in 207e8868
)
2016-04-03 21:09:30 +02:00
Axel Burri
302400d640
btrbk: bugfix: disallow snapshot_preserve_* in target section
2016-04-03 15:13:16 +02:00
Axel Burri
a7cd4a994c
btrbk: add some extra safety when running shell commands
2016-04-02 14:13:16 +02:00
Axel Burri
86170e6b21
btrbk: bugfix: untaint result of system_realpath()
2016-04-02 14:10:35 +02:00
Axel Burri
407d25f604
ssh_filter_btrbk: cosmetics: fix indentation (remove tabs)
2016-03-31 17:24:24 +02:00
Axel Burri
ccb5ed5e71
ssh_filter_btrbk: allow "realpath" and "cat /proc/self/mounts" on targets
2016-03-31 17:24:24 +02:00
Axel Burri
90a3537433
documentation: add documentation for target propagation and target directories
2016-03-31 17:24:24 +02:00
Axel Burri
79caba4267
btrbk: rename %symlink -> %realpath_cache (returning real_path instead of real_url)
2016-03-31 17:24:24 +02:00
Axel Burri
7ee5778dee
btrbk: bugfix: print correct target on "same backup target error"
2016-03-31 17:24:24 +02:00
Axel Burri
c4073f6c53
btrbk: print target_path instead of target_subvol for "list {target,config}"
2016-03-31 17:24:24 +02:00
Axel Burri
3ada7c174e
btrbk: allow targets to be directories (use mountpoint framework)
2016-03-31 17:24:24 +02:00
Axel Burri
06043cf800
btrbk: add btrfs mountpoint resolving functionality
2016-03-31 17:24:23 +02:00
Axel Burri
de96f267b8
btrbk: propagate target sections to (sub-)subsections (allow target sections everywhere in the config)
2016-03-31 17:24:18 +02:00
Axel Burri
f9ca7504c8
btrbk: add configuration option "rate_limit" (using pv -L)
...
Original patch provided by @janpascal: "Jan-Pascal van Best"
2016-03-23 11:58:35 +01:00
Axel Burri
e6d46e8a02
btrbk: fix regression: correctly handle previously received subvolumes in get_latest_common()
...
regression from: 8819c67502
2016-03-22 19:30:21 +01:00
Axel Burri
7bb18050f8
btrbk: detect interrupted transfers of raw targets; delete incomplete raw targets on action "clean"
2016-03-22 19:28:05 +01:00
Moritz Ulrich
d47cc25f60
btrbk-mail: bugfix: use `btrbk` instead of unbound variable `$btrbk`
2016-03-21 18:52:53 +01:00
Axel Burri
c2b11775a0
btrbk: cosmetics: adapt debug/trace messages
2016-03-16 19:21:48 +01:00
Axel Burri
1adb318f02
documentation: cosmetics: change all url from www.digint.ch to digint.ch
2016-03-16 18:34:28 +01:00
Axel Burri
cd8ac043a8
ChangeLog: add missing items
2016-03-16 18:34:28 +01:00
Axel Burri
247f023bab
btrbk: allow wildcards in subvolume section; add option "wildcards" in check_file()
2016-03-16 18:17:44 +01:00
Axel Burri
b9fa3e6e90
btrbk: add init_config(); use default config in action "diff"; use root config context for action "origin"
2016-03-15 16:54:54 +01:00
Axel Burri
8819c67502
btrbk: fixed raw targets
2016-03-15 14:53:51 +01:00
Axel Burri
e9bc4950ac
btrbk: re-ordering of functions (no functional changes)
2016-03-15 11:21:59 +01:00
Axel Burri
207e8868da
btrbk: no more copy of node information in vinfo by vinfo_set_detail(); always use vinfo->{node}{key}; cleanup
2016-03-14 20:21:12 +01:00
Axel Burri
9a68ab6519
btrbk: use symlink hash instead of REAL_URL
2016-03-14 15:56:20 +01:00
Axel Burri
cab2a88843
btrbk: move url_cache lookup to vinfo_subvol_list
2016-03-14 12:59:24 +01:00
Axel Burri
14d1ca1976
btrbk: add warning if a receive target of resume candidate exists at unexpected location
2016-03-12 19:16:07 +01:00
Axel Burri
1b45db3c59
btrbk: simplify btr_tree: SUBTREE is now list instead of hash; add TREE_ROOT pointer to every node; cleanup
2016-03-11 14:55:22 +01:00
Axel Burri
97caced09d
btrbk: rename %btrfs_tree_cache -> %url_cache, %uuid_info -> %uuid_cache; cleanup
2016-03-10 22:21:55 +01:00
Axel Burri
84820933ed
btrbk: remove %uuid_url_map (replace by get_cached_url_by_uuid() operating on %btrfs_tree_cache)
2016-03-10 22:21:55 +01:00
Axel Burri
743d7704f5
btrbk: correctly fill cache; fix vinfo_set_detail; add debug functionality (VINFO(), SUBTREE_LIST()); cleanup
2016-03-10 22:21:55 +01:00
Axel Burri
e85b6dadf1
btrbk: data structure refactoring:
...
- remove %subvol_list_cache: may slow down aa bit, but makes possible
to inject nodes correctly
- simplify subtree list (is now an array as it should have been from
the beginning); correctly fill tree_cache
- fix vinfo_set_detail; cleanup
2016-03-10 22:19:36 +01:00
Axel Burri
1d054bf04a
btrbk: refactoring of add global caches: reduce btrfs-progs calls, and make sure all root vinfo (especially targets) with same URL share the same SUBVOL_LIST reference.
...
- %btrfs_tree_cache (replaces %root_tree_cache)
- %subvol_list_cache (replaces %vinfo_cache):
- vinfo_init_root() (was: vinfo_root()) now lookups in cache before
calling btrfs_subvolume_detail()
- vinfo_subvol_list() now lookups in cache before calling
btrfs_subvolume_list()
2016-03-09 19:52:45 +01:00
Axel Burri
ba90c13320
btrbk: fixed schedule() debug text
2016-03-08 18:22:58 +01:00
Axel Burri
c1b27c744b
btrbk: clone target subvolume tree if same url as other target (less btrfs calls, shared SUBVOL_LIST)
2016-03-08 16:41:02 +01:00
Axel Burri
eba08f2ca3
btrbk: add config_preserve_hash(); fix macro_delete()
2016-03-08 15:31:16 +01:00
Axel Burri
5cc908313a
btrbk: cleanup trace output; cosmetics
2016-03-08 15:31:08 +01:00
Axel Burri
f770488d85
btrbk: adapt all actions to use vinfo_subsection()
2016-03-07 22:54:27 +01:00
Axel Burri
fbbd82114d
btrbk: move SUBVOL_RECEIVED, SUBVOL_DELETED, SNAPSHOT_CREATED, SNAPSHOT_UP_TO_DATE data from config to corresponding vinfo
2016-03-07 21:45:12 +01:00
Axel Burri
6f1e94eb27
btrbk: adapt action "run" to use vinfo_subsection()
2016-03-07 20:47:24 +01:00
Axel Burri
b2be1357eb
btrbk: fixed vinfo_set_detail(), while being very paranoid; fixed vinfo_subsection (was: valid_subsection_vinfo); adaptions in vinfo readin (working again)
2016-03-07 20:30:06 +01:00
Axel Burri
ab4ded9830
btrbk: ABORTED() now sets $abrt to last message (useful for warnings after abort)
2016-03-07 20:29:57 +01:00
Axel Burri
96faae9659
btrbk: be harsh, remove sroot, droot, svol in config (will break a lot of things!)
2016-03-07 19:15:57 +01:00
Axel Burri
d3148851c5
btrbk: first adaptions for vinfo holding config
2016-03-07 17:36:02 +01:00
Axel Burri
ceb346db66
btrbk: skeleton for vinfo holding config
2016-03-07 17:35:17 +01:00
Axel Burri
5030d54318
btrbk: split "check for duplicate snapshot locations" from "fill vinfo hash"
2016-03-07 15:33:37 +01:00
Axel Burri
46bd1ad52a
btrbk: add function macro_delete(), used by snapshot/backup delete
2016-03-02 00:04:24 +01:00
Axel Burri
e806d4812f
btrbk: cosmetics: adapt debug text and variable names for macro_send_receive() and similar
2016-03-01 21:55:09 +01:00
Axel Burri
6c9643f2be
btrbk: action "diff": print total size
2016-03-01 21:52:06 +01:00
Axel Burri
a1124053a7
btrbk: bugfix: sort numerically (low prio, affects only list output)
2016-03-01 19:31:43 +01:00
Axel Burri
ac1b7271c4
btrbk: read readonly flag in btrfs_subvolume_list(). this requires an additional call to btrfs-progs.
2016-03-01 15:10:37 +01:00
Axel Burri
9eb38ac9d0
btrbk: add {snapshot,target}_preserve shortcut
2016-03-01 12:30:35 +01:00
Axel Burri
b90cc132c1
documentation: add documentation for {snapshot,target}_preserve_yearly
2016-03-01 12:07:37 +01:00
Axel Burri
4aa4be3942
btrbk: different (correct) text output for scheduler results
2016-03-01 11:40:27 +01:00
Axel Burri
a049d18b90
btrbk: implement {snapshot,target}_preserve_yearly
2016-03-01 11:40:20 +01:00
Axel Burri
cf8e136681
documentation: cosmetics: use "*" instead of "-" for enumerations; two newlines before headings
2016-02-29 14:02:36 +01:00
Axel Burri
4a41413793
documentation: btrbk.1: more precice description of "btrbk list latest"
2016-02-03 12:43:20 +01:00
Axel Burri
8b071c5827
documentation: FAQ: change note about re-sending subvolumes (kernels 4.4 fix the issue)
2016-02-03 12:39:49 +01:00
Axel Burri
4434bc17ef
changed version to 0.22.2
2016-02-02 11:26:09 +01:00
Axel Burri
e913b23e99
btrbk: fixed debug/trace output of btrfs_filesystem_usage()
2016-02-01 17:07:17 +01:00
Axel Burri
6f66f72c26
btrbk: bugfix: fix checks on "btrfs sub show" output, which resulted in breakage on btrfs-progs < 4.1
2016-02-01 17:05:12 +01:00
Axel Burri
d3990bcc90
btrbk: increment copyright year
2016-01-21 17:41:40 +01:00
Axel Burri
c5d256bbf6
documentation: ssh_filter_btrbk.1: fixed release date
2016-01-21 17:41:06 +01:00
Axel Burri
872779398e
changed version to 0.22.1
2016-01-20 18:47:29 +01:00
Axel Burri
13a656a6d4
btrbk: add more sophisticated checks for possible future incompatibilities of btrfs-progs
2016-01-20 18:22:08 +01:00
Axel Burri
7a4aa4b650
btrbk: add support for btrfs-progs v4.4
2016-01-20 17:53:36 +01:00
Axel Burri
9595adc2a5
changed version to 0.22.0
2016-01-19 21:08:19 +01:00
Michael Düll
14c5c41e72
btrbk: make pv more useful by passing parameters.
...
Disabling the non-functional progress bar and
adding average and written byte counters.
Signed-off-by: Michael Düll <michael.duell@rub.de>
Remove -e option (-trab instead of -traeb).
Also add same options to btrfs_send_to_file().
Signed-off-by: Axel Burri <axel@tty0.ch>
2016-01-19 18:01:24 +01:00
Axel Burri
614438183f
btrbk: bugfix: run_cmd: do not redirect all stderr output, as this kills progress-viewer (pv) output
2016-01-19 17:52:27 +01:00
Axel Burri
a1698ef4b0
btrbk: print "$hostname:$path" instead of "{$hostname}$path" in summary and logs
2016-01-17 19:44:59 +01:00
Axel Burri
8a29ced0c9
btrbk: add up-to-date flag to stats; print "target/snapthot_name.*" instead of just "target" in stats
2016-01-17 18:56:14 +01:00
Stuart Cardall
f21ef824a7
documentation: README: add installation instructions for Alpine Linux
2016-01-16 13:26:50 +01:00
Axel Burri
5a4f4744c9
btrbk: cosmetics (remove obsolete line of code)
2016-01-15 02:30:42 +01:00
Axel Burri
e7ff20114c
btrbk: add "stats" action (print snapshot/backup statistics)
2016-01-15 02:06:03 +01:00
Axel Burri
a82c1f533a
btrbk: added configuration options "raw_target_compress_level", "raw_target_compress_threads"
2016-01-14 18:02:53 +01:00
Axel Burri
3461f9440b
btrbk: bugfix: allow filter for action "clean"
2016-01-14 16:39:43 +01:00
Axel Burri
9718ad1460
btrbk: add "-n, --dry-run" option
2016-01-14 16:11:33 +01:00
Axel Burri
3624a8fba0
btrbk: add "clean" action (delete incomplete, garbled backups)
2016-01-14 16:11:30 +01:00
Axel Burri
3a1610622d
btrbk: bugfix
2016-01-14 15:03:55 +01:00
Axel Burri
51ddb20232
btrbk: set status=incomplete in "btrbk list backups" if received_uuid is not set but target subvolume matches our naming
2016-01-13 15:32:22 +01:00
Axel Burri
33c19e622a
btrbk: bugfix: fix monthly schedule if older than 10 weeks
2015-12-17 19:00:45 +01:00
Nicolas Porcel
3b740948fb
btrbk: bugfix: config option "timestamp_format long": correct number of arguments for sprintf (breaks when using perl v5.22.0)
2015-12-15 12:49:34 +01:00
Axel Burri
a0670dcb5c
documentation: FAQ: add section for "sneakernet" data transfer
2015-11-09 13:02:55 +01:00
Axel Burri
1342f43411
documentation: btrbk.conf.5: cosmetics: dont use bullet lists
2015-11-02 20:09:19 +01:00
Axel Burri
93eb4dc5a4
documentation: README: fixed debian link: stretch(testing) is more elevated than sid(unstable)
2015-11-02 19:57:14 +01:00
Axel Burri
cb01507bb1
changed version to 0.21.0
2015-10-25 12:29:52 +01:00
Axel Burri
9922e5ae8b
Makefile: add new files: contrib/cron/btrbk-mail, doc/ssh_filter_btrbk.1 and doc/FAQ.md
2015-10-25 12:20:59 +01:00
Axel Burri
612b9fda6c
btrbk: check files for directory traversal; cosmetics
2015-10-25 12:20:59 +01:00
Axel Burri
799665bac1
documentation: moved documentation on non-btrfs sources from FAQ to README; adapted key features and debian link
2015-10-25 12:20:59 +01:00
Axel Burri
5c8d3f94f3
contrib: cron: btrbk-mail: append rsync stats to mail body
2015-10-25 12:20:59 +01:00
Axel Burri
cb1b4d146d
contrib: cron: btrbk-mail: add rsync and mount/umount functionality
2015-10-25 12:20:59 +01:00
Axel Burri
4925f3ac7d
contrib: cron: btrbk-mail: wrapper script sending email with btrbk results and exit codes
2015-10-25 12:20:59 +01:00
Axel Burri
aa9a03ae6c
documentation: more detailed information about raw targets in README.md and btrbk.conf.5; fixed outdated information in FAQ.md
2015-10-25 12:20:55 +01:00
Axel Burri
e732b92dd5
btrbk: always preserve all raw targets (as long as incremental rotation is not implemented)
2015-10-23 19:12:37 +02:00
Axel Burri
1360e059a4
btrbk: construct a (fake) uuid for raw files, and set parent_uuid correctly (fixes "origin" command)
2015-10-23 19:12:37 +02:00
Axel Burri
ab356937d5
btrbk: add "--override=KEY=VALUE" command line option (disabled for now)
2015-10-23 19:12:37 +02:00
Axel Burri
daedfb88a2
btrbk: bugfix: correct $raw_postfix_match
2015-10-23 19:12:37 +02:00
Axel Burri
3f09d2c37f
btrbk/documentation: rename "resolve *" commands to "list *"; cleanup
2015-10-22 17:59:17 +02:00
Axel Burri
288e9e73c8
btrbk: bugfix: correctly list snapshots with no targets for "resolve snapshots" command; cosmetics
2015-10-22 17:25:20 +02:00
Axel Burri
9af3344676
btrbk: dont print empty snapshot/backup schedule
2015-10-21 21:58:30 +02:00
Axel Burri
f526d454f7
btrbk: parse stderr from send/receive commands (error on /^ERROR/), as "btrfs receive" returns 0 even if nothing is received.
2015-10-21 13:51:31 +02:00
Axel Burri
da86557b89
btrbk: add signal handler for SIGINT, dumping transaction log
2015-10-20 22:19:35 +02:00
Axel Burri
cea3781ed2
btrbk: add output file support for print_formatted() function
2015-10-20 22:19:35 +02:00
Axel Burri
bfda14358e
btrbk: correctly close config file after parsing
2015-10-20 22:19:35 +02:00
Axel Burri
79a66caed6
btrbk: add real transaction (starting - run_cmd - status)
2015-10-20 22:19:35 +02:00
Axel Burri
32028850bd
btrbk: fix "resolve targets" for btrfs_progs_compat=yes; cleanup
2015-10-20 22:19:29 +02:00
Axel Burri
fef691aa04
btrbk: remove tree output for "resolve snapshots"; cleanup
2015-10-20 15:59:16 +02:00
Axel Burri
40a384e7c7
btrbk: dont ignore non-btrbk files in "resolve targets"; print debug when ignoring non-btrbk files in other places
2015-10-20 13:57:29 +02:00
Axel Burri
05bfeaff1b
btrbk: replace "info" command with "usage", with tabular output; add support for right-aligned columns
2015-10-19 22:10:08 +02:00
Axel Burri
fd985d0245
btrbk: use less confusing *_subvol instead of *_path for table output headings; cleanup table formats
2015-10-19 20:46:00 +02:00
Axel Burri
4a1b6545f4
btrbk: add commands "resolve snapshots|targets|latest" (replacing "tree")
2015-10-19 20:45:10 +02:00
Axel Burri
f01784e2d0
btrbk: correct exit status for informational commands (also exit=10 if some aborted)
2015-10-14 16:53:46 +02:00
Axel Burri
2c46e52118
btrbk: cosmetics: duration is undef on dryrun; transaction log messages are prefixed with #; "finished" transaction prints status "partial" or "success"; print duration in transaction log
2015-10-14 14:33:53 +02:00
Axel Burri
1a536811ed
Merge branch 'enhance_output'
2015-10-13 20:11:03 +02:00
Axel Burri
bca413b7ca
documentation: add missing "config print" command; add predefined "list" filters; cosmetics; fix FAQ
2015-10-13 20:08:10 +02:00
Axel Burri
46c7841e93
btrbk: add transaction log (configuration option "transaction_log <file>"
2015-10-13 20:08:10 +02:00
Axel Burri
282668927d
btrbk: cosmetics on table format: no trailing whitespace
2015-10-13 20:08:10 +02:00
Axel Burri
fa382d5e6d
btrbk: add global table format definitions; bugfix on action_log table
2015-10-13 20:08:10 +02:00
Axel Burri
10a7f98579
btrbk: add vinfo_prefixed_keys() function, which resolves a vinfo into hash of prefixed (url,path,host,rsh) for formatted lists
2015-10-13 20:08:09 +02:00
Axel Burri
0a6599aa78
btrbk: globally use new ABORTED macro, which also adds an entry to the action_log
2015-10-13 20:08:09 +02:00
Axel Burri
5356f83dfc
btrbk: add action_log, a nice way to keep track and list the actions (snapshot/delete/send-receive)
2015-10-13 20:08:07 +02:00
Axel Burri
93249d1154
btrbk: show scheduling summary if -v is set on run/dryrun
2015-10-13 20:08:07 +02:00
Axel Burri
01b7ab0ebf
btrbk: add "-t, --table" command line option (shortcut for "--format=table")
2015-10-13 20:08:04 +02:00
Axel Burri
07f7bfe3a6
btrbk: fixed sort order in table format of run/dryrun actions
2015-10-13 20:08:04 +02:00
Axel Burri
1ac801c0a6
btrbk: add "list volume|source|target" actions (special output of configuration list)
2015-10-13 20:08:00 +02:00
Axel Burri
956b010143
documentation: add "--format=table|long|raw" command line option
2015-10-13 20:02:02 +02:00
Axel Burri
b65602f848
btrbk: bugfix/cleanup on formatting
2015-10-13 20:02:02 +02:00
Axel Burri
e5c629e218
btrbk: use formatted output on run/dryrun actions; cleanup
2015-10-13 20:02:02 +02:00
Axel Burri
b1188484f0
btrbk: use command line option "--format=table|raw" in action tree (needs cleanup)
2015-10-13 20:02:01 +02:00
Axel Burri
7bb7883be7
btrbk: changed command "config dump" to "list", with new --format=table|raw command line option (needs cleanup)
2015-10-13 20:02:01 +02:00
Axel Burri
03db6883c7
btrbk: add framework for printing formatted output (tabular or key="value"...)
2015-10-13 20:02:01 +02:00
Axel Burri
e87373b043
btrbk: add "config print" action: prints internal representation of config
2015-10-13 20:02:01 +02:00
Axel Burri
d445dd0b12
btrbk: print "Dryrun: YES" in backup summary header if dryrun is set
2015-10-13 20:02:01 +02:00
Axel Burri
1905d80969
btrbk: return exit status 10 instead of 0 if one or more backup tasks aborted, and exit status 2 on parse errors
2015-09-30 14:00:39 +02:00
Axel Burri
e177ae1c87
Merge branch 'target_raw'
2015-09-29 21:57:17 +02:00
Axel Burri
92159d862a
btrbk: additional test for non-zero target file after raw backup, as failure is not detected by exit code
2015-09-29 21:49:23 +02:00
Axel Burri
bed00cdb8a
documentation: added "target raw" and "timestamp short|long" documentation to btrbk.conf(5), as well as an example for raw targets in README.md
2015-09-29 21:48:56 +02:00
Axel Burri
31e91e8bcd
btrbk: enforce preserve of all raw incremental images with new FORCE_PRESERVE tag; changed raw target names; added "timestamp_format short|long" configuration option (YYYYMMDD or YYYYMMDD<T>HHMM)
2015-09-29 21:48:47 +02:00
Axel Burri
370f435297
btrbk: bugfix: correctly handle "incremental no" option
2015-09-29 14:10:13 +02:00
Axel Burri
c06bca17bd
btrbk: new target_type "raw": send subvolume to file rather than receiving it, with compression and encryption support; added configuration options "raw_target_compress", "raw_target_encrypt", "gpg_keyring", "gpg_recipient"; skip deletion of raw targets for now;
2015-09-26 14:02:55 +02:00
Axel Burri
d73e3f184b
btrbk: added "config dump" command (tagged as experimental): dump filtered btrbk config, useful for scripting
2015-09-24 16:00:35 +02:00
Axel Burri
b3d8c1f15f
btrbk: allow filtering by "<target-directory>/<snapshot-name>", which makes it possible to pinpoint a single target
2015-09-24 14:56:22 +02:00
Axel Burri
8059fa28db
documentation: added documentation for ---raw-output command line option
2015-09-24 01:02:42 +02:00
Axel Burri
a1467fa629
btrbk: added command-line option "--raw-output", affects commands "run", "dryrun" and "tree"
2015-09-23 14:10:13 +02:00
Axel Burri
06bfe2a004
btrbk: bugfix: sort snapshots by cgen instead of PATH in action "tree"
2015-09-23 11:10:42 +02:00
Felix Eckhofer
0e24738d65
documentation: cron examples: silence output on successful runs in cron
2015-09-20 19:38:01 +02:00
Felix Eckhofer
c29f552119
documentation: cron examples: replace shell by btrbk
...
There's no point of having the shell process around while the backup is
running.
2015-09-20 19:01:39 +02:00
Felix Eckhofer
411165dd39
documentation: cron examples: use system's default shell
2015-09-20 19:00:53 +02:00
Axel Burri
dd6104339e
btrbk: added "ssh_cipher_spec" configuration option, overriding default SSH ciphers (ssh -c option)
2015-09-20 18:32:19 +02:00
Axel Burri
4115941478
ChangeLog: added changes since v0.20.0 to btrbk-current
2015-09-20 17:51:32 +02:00
Axel Burri
269b3611ac
documentation: added "FILTER STATEMENT" section in btrbk(1), and "group" configuration option in btrbk.conf(5)
2015-09-20 17:47:46 +02:00
Axel Burri
d64aea9cc9
btrbk: allow targets for subvolume/group command-line argument
2015-09-20 17:39:47 +02:00
Axel Burri
e7c6e37bd0
btrbk: implemented "group" configuration option and filtering for volume/subvolume
2015-09-20 17:39:17 +02:00
Axel Burri
8bc1acc672
documentation: FAQ: added item "How can I backup from non-btrfs hosts?"
2015-09-10 15:03:35 +02:00
Axel Burri
8ba2d6e6b1
documentation: README: updated example usage of ssh_filter_btrbk.sh, added hints on chroot and sudo options
2015-09-10 14:02:51 +02:00
Axel Burri
f01304df35
ssh_filter_btrbk: refactoring/hardening:
...
- switched to bash interpreter
- enable fine-grained (--source, --target, ...) capabilities by command-line options
- added "--restrict_path" command-line option
- added sudo flag
- added man-page
- print SSH_ORIGINAL_COMMAND in error message
2015-09-10 14:02:32 +02:00
Axel Burri
28abe96747
btrbk: added "prefix/postfix" options to config_key() function, simplifying snapdir handling
2015-09-10 12:11:54 +02:00
Axel Burri
38a8c1c9eb
documentation: btrbk(1): added missing command line options in synopsis section
2015-09-03 18:13:09 +02:00
Axel Burri
bed9fe1f66
documentation: disable hyphenation and justification in man-pages; use .PP and .RS 4 instead of .TP, which creates more predictable output
2015-09-03 18:02:19 +02:00
Axel Burri
5b0e618632
changed version to 0.20.0
2015-09-02 12:27:13 +02:00
Axel Burri
99c70e38a5
Makefile: install ssh_filter_btrbk.sh as executable
2015-09-02 12:06:23 +02:00
Axel Burri
22d3e95e3a
btrbk: bugfix: correct handling of empty "snapshot_dir"
2015-09-02 11:48:32 +02:00
Jan Wagner
68876f0562
btrbk: added "ssh_compression" configuration option for setting the SSH compression flag
2015-09-02 11:22:50 +02:00
Axel Burri
79f52924b6
btrbk: fixed wrong "--version" line in help message
2015-08-27 11:57:58 +02:00
Axel Burri
d8e8df0ebd
btrbk: added command line option "--progress", which simply pipes btrfs send through `pv`
2015-08-15 18:43:03 +02:00
Axel Burri
752dbc6157
btrbk: accept long options (use Getopt::Long instead of Getopt::Std)
2015-08-15 18:30:14 +02:00
Axel Burri
7017e14c32
documentation: btrbk.1: added missing information about the "-r" command line option
2015-08-13 22:17:01 +02:00
Axel Burri
d09d81fbeb
btrbk: added configuration option "ssh_port"
2015-08-13 21:50:26 +02:00
Axel Burri
fd94bc25fc
btrbk: use arrays as arguments for run_cmd(), making it compatible with the adaptions in the open3 branch
2015-08-07 16:10:34 +02:00
Axel Burri
a802674d11
btrbk: cosmetics (fixed typo in log message)
2015-07-27 12:21:42 +02:00
Axel Burri
4b6e77c530
documentation: README.md: updated debian installation instructions (btrbk is in debian testing)
2015-07-17 16:04:27 +02:00
Axel Burri
bb2672566f
documentation: doc/FAQ.md: fixed headings
2015-07-17 14:32:35 +02:00
Axel Burri
eae6469694
documentation: doc/FAQ.md: added information on btrfs root problem
2015-07-17 14:22:44 +02:00
Axel Burri
2b0451c701
documentation: README.md: added FAQ section, pointing to doc/FAQ.md
2015-07-17 00:44:12 +02:00
Axel Burri
748bbbfd62
Merge branch 'faq'
2015-07-17 00:29:16 +02:00
Axel Burri
0586d2a545
ChangeLog: use "close" instead of "closes" for closed issues
2015-07-08 18:24:55 +02:00
Axel Burri
bab8f1771b
ssh_filter_btrbk: no fail if either $LOGNAME or $SSH_CLIENT are not set; added log_cmd() function; use relative path for "logger" command; cosmetics
2015-07-08 18:08:19 +02:00
Yaroslav Halchenko
f8c64c4f27
ssh_filter_btrbk: fail if any command fails, or var is undefined
2015-07-08 18:02:21 +02:00
Axel Burri
97286ab34c
changed version to 0.19.3
2015-06-21 15:37:04 +02:00
Axel Burri
76f15624f3
btrbk: adaptions for btrfs-progs >= 4.1: different output for "btrfs subvolume show"
2015-06-21 13:45:23 +02:00
Axel Burri
360deca5f2
btrbk: correct parsing of btrfs subvolume list (allow id < top_level)
2015-06-17 12:42:29 +02:00
Axel Burri
8a53b3874c
btrbk: bugfix: minor bug when sorting in schedule()
2015-06-10 13:10:45 +02:00
Axel Burri
eab34c9d68
btrbk: set development version
2015-06-10 13:10:29 +02:00
Axel Burri
f58fe6f3df
documentation: doc/FAQ.md: fixed mistakes, cleanup markdown (thanks Bernd)
2015-06-10 11:26:13 +02:00
Axel Burri
5973509428
documentation: doc/FAQ.md: added FAQ
2015-06-09 16:23:20 +02:00
Axel Burri
842f8cb201
changed version to 0.19.2
2015-06-07 12:33:27 +02:00
Axel Burri
16cfb600b7
btrbk: workaround for btrfs-progs < 3.17.3 (returns exit status 0 on errors for "btrfs subvolume show")
2015-06-07 11:52:39 +02:00
Axel Burri
5ab5175340
btrbk: bugfix: dont print error messages check_file() when called without key/config_file hints
2015-06-07 11:36:12 +02:00
Axel Burri
26d154e563
documentation: README.md: cosmetics (gentoo emerge command)
2015-06-02 22:07:42 +02:00
Axel Burri
e3da1f718f
changed version to 0.19.1
2015-06-01 12:48:31 +02:00
Axel Burri
db6a1a464a
btrbk: bugfix: check undef on ABORTED flag in summary
2015-06-01 12:45:24 +02:00
Axel Burri
bb7aa10b23
btrbk: always use "cgen" for snapshots (correct handling after a "btrfs balance", where "gen" is set to current generation)
2015-06-01 12:41:43 +02:00