Commit Graph

585 Commits (6cb98700d82279fdfcb2b5090045a59b275e8256)

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