]> code.delx.au - monosys/blob - bsnap/README.md
notes: fix raspi install notes, also @home -> @username
[monosys] / bsnap / README.md
1 # bsnap
2
3 Manage snapshots for backups using LVM or btrfs. This is intended for use with [borg](https://www.borgbackup.org) or [rsync](https://rsync.samba.org).
4
5 ## Usage
6
7 Running `bsnap on` will do the following:
8 - Create a new directory `/a` where the snapshots will be mounted.
9 - Take snapshots as configured in your `/etc/fstab`.
10 - Mount the snapshots into `/a`.
11
12 At this point you can run something like [borg](https://www.borgbackup.org) or [rsync](https://rsync.samba.org) on `/a` to create your backup. Once that's completed you then run `bsnap off` to unmount, remove the snapshots and cleanup `/a`.
13
14 You must configure your `/etc/fstab` by setting the second last column for each entry:
15 - `0` -- no snapshot will be taken and the filesystem will not be mounted into `/a`
16 - `1` -- no snapshot will be taken but the filesystem will be bind mounted into `/a`
17 - `2` -- a snapshot will be taken and the snapshot will be mounted into `/a`
18
19 ```
20 # Snapshot the LVM root filesystem
21 /dev/mapper/vg-root / ext4 defaults 2 0
22
23 # Mount it into /a so it's included in the backup without snapshotting it
24 UUID="ABCD-1234" /boot vfat defaults 1 0
25 ```