From: James Bunton Date: Mon, 20 Jan 2020 13:55:56 +0000 (+1100) Subject: README X-Git-Url: https://code.delx.au/monosys/commitdiff_plain/1506876e0706a580fd00a240f078639178d80a9b README --- diff --git a/README.md b/README.md new file mode 100644 index 0000000..e4e7322 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# bsnap + +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). + +## Usage + +Running `bsnap on` will do the following: +- Create a new directory `/a` where the snapshots will be mounted. +- Take snapshots as configured in your `/etc/fstab`. +- Mount the snapshots into `/a`. + +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`. + +You must configure your `/etc/fstab` by setting the second last column for each entry: +- `0` -- no snapshot will be taken and the filesystem will not be mounted into `/a` +- `1` -- no snapshot will be taken but the filesystem will be bind mounted into `/a` +- `2` -- a snapshot will be taken and the snapshot will be mounted into `/a` + +``` +# Snapshot the LVM root filesystem +/dev/mapper/vg-root / ext4 defaults 2 0 + +# Mount it into /a so it's included in the backup without snapshotting it +UUID="ABCD-1234" /boot vfat defaults 1 0 +```