Commit Graph

134 Commits (5428e9cd93f24cc4ecd77651db876d2f82a70adc)

Author SHA1 Message Date
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 356231bc2a btrbk: abort if source subvolume has readonly or received_uuid flag 2017-07-29 19:03:23 +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 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 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 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 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 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 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
Axel Burri 57be688f6b btrbk: bugfix: fix "list latest" with no snapshots 2016-11-12 13:21:33 +01: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 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 96f0d4c175 btrbk: fix and cleanup stream compression 2016-08-24 15:25:48 +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 9913e2785a documentation: add stream_compress documentation, update Changelog 2016-08-19 17:36:33 +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 9a5e8311be change version to 0.23.3 2016-07-14 01:41:45 +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 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 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
Axel Burri cb0851c8b6 change version to 0.23.1 2016-05-03 16:21:34 +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 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 7a469597ac documentation: describe transaction log table format; cosmetics 2016-04-28 12:44:33 +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 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 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 a27f99af46 change version to 0.23.0-rc1 2016-04-17 21:46:56 +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 689d3d1233 btrbk: action "archive": print created subdirectories on summary; cleanup 2016-04-16 17:31:14 +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 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 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 ccc2a35520 ChangeLog: update missing items 2016-04-07 15:53:50 +02:00
Axel Burri 90a3537433 documentation: add documentation for target propagation and target directories 2016-03-31 17:24:24 +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