mirror of https://github.com/digint/btrbk
documentation: cosmetics: use "*" instead of "-" for enumerations; two newlines before headings
parent
4a41413793
commit
cf8e136681
94
README.md
94
README.md
|
@ -13,15 +13,15 @@ policy".
|
||||||
|
|
||||||
Key Features:
|
Key Features:
|
||||||
|
|
||||||
- Atomic snapshots
|
* Atomic snapshots
|
||||||
- Incremental backups
|
* Incremental backups
|
||||||
- Configurable retention policy
|
* Configurable retention policy
|
||||||
- Backups to multiple destinations
|
* Backups to multiple destinations
|
||||||
- Transfer via ssh
|
* Transfer via ssh
|
||||||
- Resume of backups (if backup target was not reachable for a while)
|
* Resume of backups (if backup target was not reachable for a while)
|
||||||
- Encrypted backups to non-btrfs destinations
|
* Encrypted backups to non-btrfs destinations
|
||||||
- Transaction log
|
* Transaction log
|
||||||
- Display file changes between two backups
|
* Display file changes between two backups
|
||||||
|
|
||||||
btrbk is intended to be run as a cron job.
|
btrbk is intended to be run as a cron job.
|
||||||
|
|
||||||
|
@ -33,29 +33,34 @@ btrbk comes as a single executable file (perl script), without the
|
||||||
need of any installation procedures. If you want the package and
|
need of any installation procedures. If you want the package and
|
||||||
man-pages properly installed, follow the instructions below.
|
man-pages properly installed, follow the instructions below.
|
||||||
|
|
||||||
|
|
||||||
Prerequisites
|
Prerequisites
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
- [btrfs-progs]: Btrfs filesystem utilities (use "btrfs_progs_compat"
|
* [btrfs-progs]: Btrfs filesystem utilities (use
|
||||||
option for hosts running version prior to v3.17)
|
"btrfs_progs_compat" option for hosts running version prior to
|
||||||
- Perl interpreter: probably already installed on your system
|
v3.17)
|
||||||
- [Date::Calc]: Perl module
|
* Perl interpreter: probably already installed on your system
|
||||||
|
* [Date::Calc]: Perl module
|
||||||
|
|
||||||
[btrfs-progs]: http://www.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs/
|
[btrfs-progs]: http://www.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs/
|
||||||
[Date::Calc]: http://search.cpan.org/perldoc?Date::Calc
|
[Date::Calc]: http://search.cpan.org/perldoc?Date::Calc
|
||||||
|
|
||||||
|
|
||||||
Instructions
|
Instructions
|
||||||
------------
|
------------
|
||||||
|
|
||||||
In order to install the btrbk executable along with the man-pages and
|
In order to install the btrbk executable along with the man-pages and
|
||||||
an example configuration file, choose one of the following methods:
|
an example configuration file, choose one of the following methods:
|
||||||
|
|
||||||
|
|
||||||
### Generic Linux System
|
### Generic Linux System
|
||||||
|
|
||||||
Download and unpack the newest stable [btrbk source tarball] and type:
|
Download and unpack the newest stable [btrbk source tarball] and type:
|
||||||
|
|
||||||
sudo make install
|
sudo make install
|
||||||
|
|
||||||
|
|
||||||
### Gentoo Linux
|
### Gentoo Linux
|
||||||
|
|
||||||
Grab the digint portage overlay from:
|
Grab the digint portage overlay from:
|
||||||
|
@ -63,16 +68,19 @@ Grab the digint portage overlay from:
|
||||||
|
|
||||||
emerge app-backup/btrbk
|
emerge app-backup/btrbk
|
||||||
|
|
||||||
|
|
||||||
### Debian Based Distros
|
### Debian Based Distros
|
||||||
|
|
||||||
btrbk is in `stretch (testing) (utils)`: https://packages.debian.org/stretch/btrbk
|
btrbk is in `stretch (testing) (utils)`: https://packages.debian.org/stretch/btrbk
|
||||||
|
|
||||||
Packages are also available via NeuroDebian: http://neuro.debian.net/pkgs/btrbk.html
|
Packages are also available via NeuroDebian: http://neuro.debian.net/pkgs/btrbk.html
|
||||||
|
|
||||||
|
|
||||||
### Arch Linux
|
### Arch Linux
|
||||||
|
|
||||||
btrbk is in AUR: https://aur.archlinux.org/packages/btrbk/
|
btrbk is in AUR: https://aur.archlinux.org/packages/btrbk/
|
||||||
|
|
||||||
|
|
||||||
### Alpine Linux
|
### Alpine Linux
|
||||||
|
|
||||||
btrbk is in `testing`, install with:
|
btrbk is in `testing`, install with:
|
||||||
|
@ -119,19 +127,19 @@ Example: laptop with usb-disk for backups
|
||||||
|
|
||||||
In this example, we assume you have a laptop with:
|
In this example, we assume you have a laptop with:
|
||||||
|
|
||||||
- a disk having a btrfs volume mounted as `/mnt/btr_pool`, containing
|
* a disk having a btrfs volume mounted as `/mnt/btr_pool`,
|
||||||
a subvolume `rootfs` for the root filesystem and a subvolume `home`
|
containing a subvolume `rootfs` for the root filesystem and a
|
||||||
for the user data.
|
subvolume `home` for the user data.
|
||||||
- a backup disk having a btrfs volume mounted as `/mnt/btr_backup`,
|
* a backup disk having a btrfs volume mounted as `/mnt/btr_backup`,
|
||||||
containing a subvolume `mylaptop` for the incremental backups.
|
containing a subvolume `mylaptop` for the incremental backups.
|
||||||
|
|
||||||
Retention policy:
|
Retention policy:
|
||||||
|
|
||||||
- keep snapshots for 14 days (very handy if you are on the road and
|
* keep snapshots for 14 days (very handy if you are on the road and
|
||||||
the backup disk is not attached)
|
the backup disk is not attached)
|
||||||
- keep monthly backups forever
|
* keep monthly backups forever
|
||||||
- keep weekly backups for 10 weeks
|
* keep weekly backups for 10 weeks
|
||||||
- keep daily backups for 20 days
|
* keep daily backups for 20 days
|
||||||
|
|
||||||
/etc/btrbk/btrbk-mylaptop.conf:
|
/etc/btrbk/btrbk-mylaptop.conf:
|
||||||
|
|
||||||
|
@ -159,12 +167,12 @@ Retention policy:
|
||||||
exec /usr/sbin/btrbk -q -c /etc/btrbk/btrbk-mylaptop.conf run
|
exec /usr/sbin/btrbk -q -c /etc/btrbk/btrbk-mylaptop.conf run
|
||||||
|
|
||||||
|
|
||||||
- This will create snapshots on a daily basis:
|
* This will create snapshots on a daily basis:
|
||||||
- `/mnt/btr_pool/btrbk_snapshots/rootfs.YYYYMMDD`
|
* `/mnt/btr_pool/btrbk_snapshots/rootfs.YYYYMMDD`
|
||||||
- `/mnt/btr_pool/btrbk_snapshots/home.YYYYMMDD`
|
* `/mnt/btr_pool/btrbk_snapshots/home.YYYYMMDD`
|
||||||
- And create incremental backups in:
|
* And create incremental backups in:
|
||||||
- `/mnt/btr_backup/mylaptop/rootfs.YYYYMMDD`
|
* `/mnt/btr_backup/mylaptop/rootfs.YYYYMMDD`
|
||||||
- `/mnt/btr_backup/mylaptop/home.YYYYMMDD`
|
* `/mnt/btr_backup/mylaptop/home.YYYYMMDD`
|
||||||
|
|
||||||
If you want the snapshots to be created only if the backup disk is
|
If you want the snapshots to be created only if the backup disk is
|
||||||
attached, simply add the following line to the config:
|
attached, simply add the following line to the config:
|
||||||
|
@ -215,10 +223,10 @@ fileserver, the config would be something like:
|
||||||
|
|
||||||
This will pull backups from alpha/beta.mydomain.com and locally create:
|
This will pull backups from alpha/beta.mydomain.com and locally create:
|
||||||
|
|
||||||
- `/mnt/btr_backup/alpha/rootfs.YYYYMMDD`
|
* `/mnt/btr_backup/alpha/rootfs.YYYYMMDD`
|
||||||
- `/mnt/btr_backup/alpha/home.YYYYMMDD`
|
* `/mnt/btr_backup/alpha/home.YYYYMMDD`
|
||||||
- `/mnt/btr_backup/beta/rootfs.YYYYMMDD`
|
* `/mnt/btr_backup/beta/rootfs.YYYYMMDD`
|
||||||
- `/mnt/btr_backup/beta/dbdata.YYYYMMDD`
|
* `/mnt/btr_backup/beta/dbdata.YYYYMMDD`
|
||||||
|
|
||||||
|
|
||||||
Example: local time-machine (daily snapshots)
|
Example: local time-machine (daily snapshots)
|
||||||
|
@ -330,10 +338,10 @@ compressed and piped through GnuPG.
|
||||||
This will create a GnuPG encrypted, compressed files on the target
|
This will create a GnuPG encrypted, compressed files on the target
|
||||||
host:
|
host:
|
||||||
|
|
||||||
- `/backup/home.YYYYMMDD.btrfs_<received_uuid>.xz.gpg` for
|
* `/backup/home.YYYYMMDD.btrfs_<received_uuid>.xz.gpg` for
|
||||||
non-incremental images,
|
non-incremental images,
|
||||||
- `/backup/home.YYYYMMDD.btrfs_<received_uuid>@<parent_uuid>.xz.gpg`
|
* `/backup/home.YYYYMMDD.btrfs_<received_uuid>@<parent_uuid>.xz.gpg`
|
||||||
for subsequent incremenal images.
|
for subsequent incremenal images.
|
||||||
|
|
||||||
I you are using raw _incremental_ backups, please make sure you
|
I you are using raw _incremental_ backups, please make sure you
|
||||||
understand the implications (see [btrbk.conf(5)], TARGET TYPES).
|
understand the implications (see [btrbk.conf(5)], TARGET TYPES).
|
||||||
|
@ -399,6 +407,7 @@ can setup a chroot environment in /etc/ssh/sshd_config (see
|
||||||
[sshd(8)]: http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man8/sshd.8
|
[sshd(8)]: http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man8/sshd.8
|
||||||
[sshd_config(5)]: http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man5/sshd_config.5
|
[sshd_config(5)]: http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man5/sshd_config.5
|
||||||
|
|
||||||
|
|
||||||
Restoring Backups
|
Restoring Backups
|
||||||
=================
|
=================
|
||||||
|
|
||||||
|
@ -407,6 +416,7 @@ to be done manually. In the examples below, we assume that you have a
|
||||||
btrfs volume mounted at `/mnt/btr_pool`, and the subvolume you want to
|
btrfs volume mounted at `/mnt/btr_pool`, and the subvolume you want to
|
||||||
have restored is at `/mnt/btr_pool/data`.
|
have restored is at `/mnt/btr_pool/data`.
|
||||||
|
|
||||||
|
|
||||||
Example: Restore a Snapshot
|
Example: Restore a Snapshot
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
|
@ -487,11 +497,11 @@ Your contributions are welcome!
|
||||||
|
|
||||||
If you would like to contribute or have found bugs:
|
If you would like to contribute or have found bugs:
|
||||||
|
|
||||||
- Visit the [btrbk project page on GitHub] and use the [issues
|
* Visit the [btrbk project page on GitHub] and use the
|
||||||
tracker] there.
|
[issues tracker] there.
|
||||||
- Talk to us on Freenode in `#btrbk`.
|
* Talk to us on Freenode in `#btrbk`.
|
||||||
- Contact the author via email (the email address can be found in the
|
* Contact the author via email (the email address can be found in
|
||||||
sources).
|
the sources).
|
||||||
|
|
||||||
Any feedback is appreciated!
|
Any feedback is appreciated!
|
||||||
|
|
||||||
|
|
|
@ -198,6 +198,7 @@ location. In some situations, is is also required to transport the
|
||||||
data physically, either to the datacenter or to your safe in the
|
data physically, either to the datacenter or to your safe in the
|
||||||
basement.
|
basement.
|
||||||
|
|
||||||
|
|
||||||
### Answer 1: Use external storage as "stream-fifo"
|
### Answer 1: Use external storage as "stream-fifo"
|
||||||
|
|
||||||
This example uses a USB disk as "stream-fifo" for transferring
|
This example uses a USB disk as "stream-fifo" for transferring
|
||||||
|
@ -217,6 +218,7 @@ USB disk. This works fine, but be aware that you may run into trouble
|
||||||
if a single stream gets corrupted, making all subsequent streams
|
if a single stream gets corrupted, making all subsequent streams
|
||||||
unusable.
|
unusable.
|
||||||
|
|
||||||
|
|
||||||
### Answer 2: Clone btrfs subvolumes
|
### Answer 2: Clone btrfs subvolumes
|
||||||
|
|
||||||
A more robust approach is to use the USB disk as secondary backup.
|
A more robust approach is to use the USB disk as secondary backup.
|
||||||
|
|
Loading…
Reference in New Issue