descriptionManage snapshots for backups using LVM or btrfs
last changeThu, 8 Aug 2019 22:51:17 +0000 (08:51 +1000)


Manage snapshots for backups using LVM or btrfs. This is intended for use with borg or rsync.


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 or rsync 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
2019-08-08 James BuntonREADME master
2019-08-08 James BuntonFix Debian packaging
2019-08-08 James BuntonStrip down to just bsnap v2.0.0-1
2019-01-17 James Buntonv1.0.6-2 v1.0.6-2
2018-11-10 James Buntonbsnap btrfs support
2018-07-24 James Buntonv1.0.5 v1.0.5-1
2018-07-24 James Buntonfix pgrep change
2018-07-21 James Buntonv1.0.4 v1.0.4-1
2018-07-21 James Buntoncheck for backup in pgrep instead of borg to avoid...
2018-03-03 James BuntonFixed typo v1.0.3-1
2018-03-03 James Buntonmakedeb: Simplify by using pkgname array
2018-03-03 James Buntonv1.0.2 v1.0.2-1
2018-03-03 James BuntonExcluding all of /var/cache causes issues
2018-03-03 James BuntonUse more awk!
2018-03-03 James Buntonmakedeb
2018-03-03 James BuntonChange backup.timer start time and add random delay v1.0.1-1
17 months ago v2.0.0-1
2 years ago v1.0.6-2
2 years ago v1.0.6-1
2 years ago v1.0.5-1
2 years ago v1.0.4-1
2 years ago v1.0.3-1
2 years ago v1.0.2-1
2 years ago v1.0.1-1
2 years ago v1.0.0-1
17 months ago master