SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG

BotDetect - Real-Time Bot Detection API
 
 

MAN page from Fedora 24 btrbk-0.26.0-47.1.noarch.rpm

BTRBK

Section: Btrbk Manual (1)
Updated: 2017-10-11
Index 

NAME

btrbk - backup tool for btrfs subvolumes 

SYNOPSIS

btrbk [-h|--help] [--version]      [-c|--config <file>] [-n|--dry-run]      [-p|--preserve] [--preserve-snapshots] [--preserve-backups]      [-v|--verbose] [-q|--quiet] [-l|--loglevel <level>]      [-t|--table] [--format <output-format>]      [--progress] [--print-schedule]      [--override <config_option>=<value>]      [--lockfile <file>]      <command> [<args>]
 

DESCRIPTION

btrbk is a backup tool for btrfs subvolumes, taking advantage of btrfs specific capabilities to create atomic snapshots and transfer them incrementally to a target btrfs filesystem. It is able to perform backups from one source to multiple destinations.

Snapshots as well as backup subvolume names are created in form:

<snapshot-name>.<timestamp>[_N]

Where <snapshot-name> is identical to the source subvolume name, unless the configuration option snapshot_name is set. The <timestamp> is either "YYYYMMDD" or "YYYYMMDDThhmm" (dependent of the timestamp_format configuration option), where "YYYY" is the year, "MM" is the month, "DD" is the day, "hh" is the hour and "mm" is the minute of the creation time (local time of the host running btrbk). If multiple snapshots/backups are created on the same date/time, N will be incremented on each snapshot, starting at 1. 

OPTIONS

-h, --help

Prints the synopsis and a list of the commands.

--version

Prints the btrbk version.

-n, --dry-run

Doncqt run anything that would alter the filesystem, just show the snapshots and backup subvolumes that would be created/deleted by therun,snapshot,resume,prune,archiveandcleancommands. Use in conjunction with-l debugto see the btrfs commands that would be executed.

-c, --config <file>

Read the configuration from <file>.

-p, --preserve

Preserve all snapshots and backups. Skips deletion of any snapshots and backups, even if specified in the configuration file (shortcut for "--preserve-snapshots --preserve-backups").

--preserve-snapshots

Preserve all snapshots. Skips deletion of any snapshots, even if specified in the configuration file.

--preserve-backups

Preserve all backups. Skips deletion of any backups, even if specified in the configuration file.

--wipe

Ignore configured snapshot retention policy, delete all but latest snapshots instead. All snapshots needed for incremental backup (latest common) are also preserved. Useful if you are getting low on disk space (ENOSPC).

-v, --verbose

Verbose output (shortcut for "--loglevel=info").

-q, --quiet

Quiet operation. If set, btrbk does not print the summary after executing therun,snapshot,resume,prune, orarchivecommands.

-l, --loglevel <level>

Set the level of verbosity. Accepted levels are warn, info, debug, and trace.

-t, --table

Print output in table format (shortcut for "--format=table").

--format table|long|raw

Print output in specified format. If set to "raw", prints space-separated key="value" pairs (machine readable). Affects output format forrun,snapshot,resume,prune,archiveandlistcommands. Useful for further exporting/scripting.

--progress

Show progress bar on send-receive operation.

--print-schedule

Print detailed scheduler information onrun,snapshot,resume,pruneandarchivecommands. Use the--formatcommand line option to switch between different output formats.

--lockfile <file>

Create lockfile <file> on startup; checks lockfile before running any btrfs commands (using perl "flock"), and exits if the lock is held by another btrbk instance. Overrides configuration option "lockfile". Ignored on dryrun (-n,--dry-run).

--override <config_option>=<value>

Override a configuration option <config_option> with <value>. Globally, for ALL contexts. Use with care!
 

COMMANDS

 

Actions

The following commands are used to create snapshots and/or backups. All actions can operate in dry-run mode (-n, --dry-run). Use the --format command line option to switch between different output formats.

See section RETENTION POLICY in btrbk.conf(5) for information on configuring the retention policy.

run [filter...]

Perform snapshot and backup operations as specified in the configuration file. If the optional [filter...] arguments are present, snapshots and backups are only performed for the subvolumes/targets matching a filter statement (seeFILTER STATEMENTSbelow).

Step 0: Read Data

Read information from the source and target btrfs filesystems in order to perform sanity checks and identify parent/child and received-from relationships.

Step 1: Create Snapshots

If the checks succeed, btrbk creates snapshots for the source subvolumes specified in the configuration file, according to thesnapshot_createoption.

Step 2: Create Backups

For each specified target, btrbk creates the backups as follows: After comparing the backups to the source snapshots, btrbk transfers all missing snapshots needed to satisfy the configured target retention policy, incrementally from the latest common parent subvolume found. If no common parent subvolume is found (or if theincrementaloption is set to lqnorq), a full (non-incremental) backup is created.

Step 3: Delete Backups

Unless the -p, --preserve or --preserve-backups option is set, backup subvolumes that are not preserved by their configured retention policy will be deleted. Note that the latest snapshot/backup pair are always preserved, regardless of the retention policy.

Step 4: Delete Snapshots

Unless the -p, --preserve or --preserve-snapshots option is set, snapshots that are not preserved by their configured retention policy will be deleted. Note that the latest snapshot (the one created in step 1) as well as the latest snapshot/backup pair are always preserved, regardless of the retention policy.

dryrun [filter...]

Doncqt run any btrfs commands that would alter the filesystem, just show the snapshots and backup subvolumes that would be created/deleted by theruncommand. Use in conjunction with-l debugto see the btrfs commands that would be executed.

snapshot [filter...]

Snapshot only: skips backup creation and deletion (steps 2 and 3). Use in conjunction with -p, --preserve (or --preserve-snapshots) if you also want to skip snapshot deletion (step 4).

resume [filter...]

Resume backups: skips snapshot creation (step 1), transfers and deletes snapshots/backups in order to satisfy their configured retention policy. Use in conjunction with -p, --preserve, --preserve-backups, --preserve-snapshots if you want to skip backup and/or snapshot deletion (steps 3, 4).

prune [filter...]

Prune snapshots and backups: skips snapshot and backup creation (steps 1, 2), only deletes snapshots and backups in order to satisfy their configured retention policy. Useful for cleaning the disk after changing the retention policy. Use in conjunction with --preserve-backups, --preserve-snapshots if you want to skip backup or snapshot deletion (steps 3, 4).

archive <source> <target> *experimental*

Recursively copy all subvolumes created by btrbk from <source> to <target> directory, optionally rescheduled usingarchive_preserve_*configuration options. Also creates directory tree on <target> (see bugs below). Useful for creating extra archive copies (clones) from your backup disks. Note that you can continue using btrbk after swapping your backup disk with the archive disk.

Note that this feature needs alinux kernel >=4.4to work correctly! Kernels >=4.1 and <4.4 have a bug when re-sending subvolumes (the archived subvolumes will have incorrect received_uuid, seehttp://thread.gmane.org/gmane.comp.file-systems.btrfs/48798), so make sure you run a recent kernel.

Known bugs: If you want to use nested subvolumes on the target filesystem, you need to create them by hand (e.g. by running "btrfs subvolume create <target>/dir"). Check the output of --dry-run if unsure.

clean [filter...]

Delete incomplete (garbled) backups. Incomplete backups can be left behind on network errors or kill signals while a send/receive operation is ongoing, and are identified by the "received_uuid" flag not being set on a target (backup) subvolume.

The following table gives a quick overview of the action commands and resulting snapshot creation (S+), backup creation (B+), snapshot deletion (S-), and backup deletion (B-):

Command   Option                 S+ B+ S- B---------------------------------------------run                              x  x  x  xrun       --preserve             x  xrun       --preserve-snapshots   x  x     xrun       --preserve-backups     x  x  xsnapshot                         x     xsnapshot  --preserve             xresume                              x  x  xresume    --preserve                xresume    --preserve-snapshots      x     xresume    --preserve-backups        x  xprune                                  x  xprune     --preserve-snapshots            xprune     --preserve-backups           x
 

Informative Commands

The following commands are informative only, and will not alter the file system.

stats [filter...]

Print statistics of snapshot and backup subvolumes. Optionally filtered by [filter...] arguments (seeFILTER STATEMENTSbelow).

list <subcommand> [filter...]

Print information defined by <subcommand> in a tabular form. Optionally filtered by [filter...] arguments (seeFILTER STATEMENTSbelow).

Available subcommands:

snapshots

List all snapshots (and corresponding backups).

backups

List all backups (and corresponding snapshots).

latest

List most recent common snapshot/backup pair, or most recent snapshot if no common found.

config

List configured source/snapshot/target relations.

source

List configured source/snapshot relations.

volume

List configured volume sections.

target

List configured targets.

Use the--formatcommand line option to switch between different output formats.

usage [filter...]

Print filesystem usage information for all source/target volumes, optionally filtered by [filter...] arguments (seeFILTER STATEMENTSbelow). Note that the "free" value is an estimate of the amount of data that can still be written to the file system.

origin <subvolume>

Print the subvolume origin tree: Shows the parent-child relationships as well as the received-from information. Use the--formatcommand line option to switch between different output formats.

diff <from> <to>

Print new files since subvolume <from> for subvolume <to>.

config print|print-all

Prints the parsed configuration file. Use the--formatcommand line option to switch between different output formats.
 

FILTER STATEMENTS

Filter arguments are accepted in form:

<group-name>

Matches thegroupconfiguration option of avolume,subvolumeortargetsection.

[hostname:]<volume-directory>

Matches all subvolumes and targets of avolumeconfiguration section.

[hostname:]<volume-directory>/<subvolume-name>

Matches the specified subvolume and all targets of asubvolumeconfiguration section.

[hostname:]<target-directory>

Matches all targets of atargetconfiguration section.

[hostname:]<target-directory>/<snapshot-name>

Matches a single target of atargetsection within asubvolumesection with given <snapshot-name>.

For convenience, [hostname:] can be specified as either "hostname:" or "ssh://hostname/". 

FILES

/etc/btrbk.conf, /etc/btrbk/btrbk.conf

Default configuration file. The file format and configuration options are described inbtrbk.conf(5).
 

EXIT STATUS

btrbk returns the following error codes:

0

No problems occurred.

1

Generic error code.

2

Parse error: when parsing command-line options or configuration file.

3

Lockfile error: if lockfile is present on startup.

10

Backup abort: At least one backup task aborted.

255

Script error.
 

AVAILABILITY

Please refer to the btrbk project page https://digint.ch/btrbk/ for further details. 

SEE ALSO

btrbk.conf(5), btrfs(8)

For more information about btrfs and incremental backups, see the web site at https://btrfs.wiki.kernel.org/index.php/Incremental_Backup 

AUTHOR

Axel Burri <axelAATTtty0.ch>


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
COMMANDS
Actions
Informative Commands
FILTER STATEMENTS
FILES
EXIT STATUS
AVAILABILITY
SEE ALSO
AUTHOR

This document was created byman2html,using the manual pages.
 
ICM Bot detect detector