Merge branch 'enhance_output'

pull/57/head
Axel Burri 2015-10-13 20:11:03 +02:00
commit 1a536811ed
6 changed files with 671 additions and 255 deletions

View File

@ -2,13 +2,17 @@ btrbk-current
* Added configuration option "group".
* Allow filtering subcommands by group as well as targets.
* Added "--raw-output" command line option, producing raw
(machine-readable) output for "(dry)run" and "tree" commands.
* Added "config dump" command (experimental).
* Added "config print" command.
* Added "list" command (experimental).
* Added "--format=table|long|raw" and "-t,--table" command line
options, producing tabular and raw (machine-readable) output for
"(dry)run", "tree" and "list" commands.
* Print scheduler details if -v option is set on action run/dryrun.
* Added configuration option "ssh_cipher_spec" (close: #47).
* Added "target raw", with GnuPG and compression support
(experimental).
* Added configuration option "timestamp_format short|long".
* Added transaction log (configuration option "transaction_log").
* Bugfix: correctly handle "incremental no" option.
* Bugfix: return exit status 10 instead of 0 if one or more backup
tasks aborted.

697
btrbk

File diff suppressed because it is too large Load Diff

View File

@ -64,6 +64,9 @@ snapshot_dir _btrbk_snap
# Set this either globally or in a specific "target" section.
#btrfs_progs_compat no
# Enable transaction log
#transaction_log /var/log/btrbk_transaction.log
#
# Volume section: "volume <volume-directory>"

View File

@ -37,12 +37,12 @@ valid mount-points, you can loop through the configuration and mount
the volumes like this:
#!/bin/sh
btrbk config dump volume | while read line; do
btrbk config list volume --format=raw | while read line; do
eval $line
$volume_rsh mount $volume_path
done
Note that the `btrbk config dump volume` command accepts filters (see
Note that the `btrbk config list` command accepts filters (see
[btrbk(1)], FILTER STATEMENTS), which means you can e.g. add "group
automount" tags in your configuration and dump only the volumes of
this group: `btrbk config dump volume automount`.

View File

@ -79,10 +79,17 @@ Set the level of verbosity. Accepted levels are warn, info, debug,
and trace.
.RE
.PP
\-\-raw\-output
\-t, \-\-table
.RS 4
Print raw (machine-readable) output. Changes output format for
\fBrun\fR, \fBdryrun\fR and \fBtree\fR. Useful for further scripting.
Print output in table format (shortcut for "--format=table").
.RE
.PP
\-\-format table|long|raw
.RS 4
Print output in specified format. If set to "raw", prints
space-separated key="value" pairs (machine-readable). Affects output
format for \fBrun\fR, \fBdryrun\fR, \fBlist\fR and \fBtree\fR
commands. Useful for further exporting/scripting.
.RE
.PP
\-\-progress
@ -121,25 +128,8 @@ configured retention policy will be deleted. Note that the latest
snapshot as well as the latest backup is always preserved, regardless
of the retention policy.
.PP
If the \-\-raw\-output command line option is set, print the output in
the following format:
.PP
.RS 4
snapshot <snapshot-url> <src-subvol-url>
...
.RE
.RS 4
receive <target-url> <src-subvol-url> [<parent-subvol-url>]
...
.RE
.RS 4
delete <target-url>
...
.RE
.RS 4
aborted [volume|subvolume|target] <url> -- abort_reason
...
.RE
Use the \fI\-\-format\fR command line option to switch between
different output formats.
.RE
.PP
.B dryrun
@ -151,12 +141,15 @@ in conjunction with \fI\-l debug\fR to see the btrfs commands that
would be executed.
.RE
.PP
.B info
.B list
[filter...]
.RS 4
Print filesystem usage information for all source/target
volumes. Optionally filtered by [filter...] arguments (see \fIFILTER
STATEMENTS\fR below).
Print the source/snapshot/target relations of the configured
subvolumes in a tabular form. Optionally filtered by [filter...]
arguments (see \fIFILTER STATEMENTS\fR below). Accepts predefined
filters \fIvolume\fR, \fIsource\fR and \fItarget\fR. Use the
\fI\-\-format\fR command line option to switch between different
output formats.
.RE
.PP
.B tree
@ -164,15 +157,16 @@ STATEMENTS\fR below).
.RS 4
Print the snapshots and their corresponding backup subvolumes as a
tree. Optionally filtered by [filter...] arguments (see \fIFILTER
STATEMENTS\fR below).
.PP
If the \-\-raw\-output command line option is set, print the output in
the following format:
.PP
.RS 4
<subvol-url> <snapshot-url> <received-from-url>
...
STATEMENTS\fR below). Use the \fI\-\-format\fR command line option to
switch between different output formats.
.RE
.PP
.B info
[filter...]
.RS 4
Print filesystem usage information for all source/target
volumes. Optionally filtered by [filter...] arguments (see \fIFILTER
STATEMENTS\fR below).
.RE
.PP
.B origin
@ -188,10 +182,11 @@ parent-child relationship as well as the received-from information.
Print new files since subvolume <from> for subvolume <to>.
.RE
.PP
.B config dump
volume|source|target [filter...] \fI*experimental*\fR
.B config
print|print-all
.RS 4
Dump parsed content from the configuration file, in format: key="value"...
Prints the parsed configuration file. Use the \fI\-\-format\fR command
line option to switch between different output formats.
.RE
.SH FILTER STATEMENTS
Filter arguments are accepted in form:

View File

@ -258,6 +258,13 @@ can lead to false guesses if the snapshot or target subvolumes are
manipulated by hand (moved, deleted).
.RE
.PP
\fBtransaction_log\fR <file>
.RS 4
If set, all transactions (snapshot create, subvolume send-receive,
subvolume delete) as well as abort messages are logged to <file>, in a
space-separated table format.
.RE
.PP
Lines that contain a hash character (#) in the first column are
treated as comments.
.SH AVAILABILITY