Commit Graph

603 Commits (c445b324596cd02591d28fd73633f4f4b272bd9c)

Author SHA1 Message Date
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