mirror of https://github.com/digint/btrbk
documentation: README.md: rephrase time-machine example
parent
3bba963784
commit
c1fa4aa73e
36
README.md
36
README.md
|
@ -94,12 +94,12 @@ the disks).
|
||||||
Example: local regular snapshots (time-machine)
|
Example: local regular snapshots (time-machine)
|
||||||
-----------------------------------------------
|
-----------------------------------------------
|
||||||
|
|
||||||
The simpliest use case is to create snapshots in the same volume as
|
The simpliest use case is to only create snapshots of your data. This
|
||||||
the data. This will obviously not protect it against hardware issues
|
will obviously not protect it against hardware failure, but can be
|
||||||
(failure, theft...), but can be useful as a protection against
|
useful for:
|
||||||
inadvertent changes or deletions, or if the data is already a copy
|
|
||||||
created with rsync or similar tools, and you just want to keep several
|
* protection against inadvertent changes or deletions
|
||||||
past states.
|
* keeping past states of copies from rsync or similar tools
|
||||||
|
|
||||||
Let's assume you need regular snapshots of your home directory, which
|
Let's assume you need regular snapshots of your home directory, which
|
||||||
is located in the subvolume `home` of the volume `/mnt/btr_pool`. The
|
is located in the subvolume `home` of the volume `/mnt/btr_pool`. The
|
||||||
|
@ -107,6 +107,7 @@ snapshots are to be stored in `btrbk_snapshots` (on the same volume).
|
||||||
|
|
||||||
/etc/btrbk/btrbk.conf:
|
/etc/btrbk/btrbk.conf:
|
||||||
|
|
||||||
|
timestamp_format long
|
||||||
snapshot_preserve_min 18h
|
snapshot_preserve_min 18h
|
||||||
snapshot_preserve 48h
|
snapshot_preserve 48h
|
||||||
|
|
||||||
|
@ -114,35 +115,36 @@ snapshots are to be stored in `btrbk_snapshots` (on the same volume).
|
||||||
snapshot_dir btrbk_snapshots
|
snapshot_dir btrbk_snapshots
|
||||||
subvolume home
|
subvolume home
|
||||||
|
|
||||||
Notice that the `target` option is not provided, since the snapshots
|
Notice that the `target` option is not provided, and btrbk will only
|
||||||
will be located on the same volume in `snapshot_dir`. The corresponding
|
manage snapshots located on the same volume in `snapshot_dir`. Btrbk
|
||||||
directory must be created manually before running btrbk:
|
does not create subdirs by default, the snapshot directory must first
|
||||||
|
be created manually:
|
||||||
|
|
||||||
sudo mkdir -p /mnt/btr_pool/btrbk_snapshots
|
sudo mkdir /mnt/btr_pool/btrbk_snapshots
|
||||||
|
|
||||||
Start a dry run:
|
Start a dry run:
|
||||||
|
|
||||||
sudo btrbk -v dryrun
|
sudo btrbk run -n
|
||||||
|
|
||||||
Create the first snapshot:
|
Create the first snapshot:
|
||||||
|
|
||||||
sudo btrbk -v run
|
sudo btrbk run
|
||||||
|
|
||||||
If it works as expected, configure a cronjob to run btrbk hourly:
|
If it works as expected, configure a cron job to run btrbk hourly:
|
||||||
|
|
||||||
/etc/cron.hourly/btrbk:
|
/etc/cron.hourly/btrbk:
|
||||||
|
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
exec /usr/bin/btrbk -q run
|
exec /usr/bin/btrbk -q run
|
||||||
|
|
||||||
|
Snapshots will now be created every hour, kept for 48h
|
||||||
|
(`snapshot_preserve`), then automatically removed.
|
||||||
|
|
||||||
With this setup, the snapshots will be kept at least for 18 hours
|
With this setup, the snapshots will be kept at least for 18 hours
|
||||||
(`snapshot_preserve_min`). This can be useful to create manual
|
(`snapshot_preserve_min`). This can be useful to create manual
|
||||||
snapshots by calling `sudo btrbk run` on the command line and keep
|
snapshots by calling `sudo btrbk run` on the command line and keep
|
||||||
them around for a while, in addition to the regular snapshots.
|
them around for a while, in addition to the regular snapshots.
|
||||||
|
|
||||||
The snapshots will be removed automatically after 48h
|
|
||||||
(`snapshot_preserve`).
|
|
||||||
|
|
||||||
|
|
||||||
Example: laptop with usb-disk for backups
|
Example: laptop with usb-disk for backups
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
@ -162,7 +164,7 @@ In this example, we assume you have a laptop with:
|
||||||
Retention policy:
|
Retention policy:
|
||||||
|
|
||||||
* keep all snapshots for 2 days, no matter how frequently you (or
|
* keep all snapshots for 2 days, no matter how frequently you (or
|
||||||
your cron-job) run btrbk
|
your cron job) run btrbk
|
||||||
* keep daily snapshots for 14 days (very handy if you are on
|
* keep daily snapshots for 14 days (very handy if you are on
|
||||||
the road and the backup disk is not attached)
|
the road and the backup disk is not attached)
|
||||||
* keep monthly backups forever
|
* keep monthly backups forever
|
||||||
|
|
Loading…
Reference in New Issue