Import scripts

* supports either local or remote usage
* always uses sudo
* getopts for a few settings
* keeps its own snapshots for send/recv purposes, independent of others
This commit is contained in:
Kevin McCormick
2016-08-03 11:55:03 -07:00
parent 26c78dff3e
commit c6a82a7ccd
2 changed files with 154 additions and 0 deletions

18
backup-boot Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
# Main system backups are carried out via ZFS send/receive,
# but that won't pick up /boot.
set -e
# ensure /boot is the real deal
mountpoint -q /boot || (echo "/boot is not a mountpoint" >&2; exit 1)
# bind mount / to a temporary path
fakeroot=$(mktemp -d)
mount --bind / $fakeroot
# copy the /boot filesystem into /'s boot/
rsync -a --delete /boot/ $fakeroot/boot/
# clean up
umount $fakeroot
rmdir $fakeroot