Commit Graph

784 Commits (5b34f620aaf135d7a84f6ee6041343d1f23f980e)

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