mirror of
https://github.com/bashclub/bashclub-zfs-push-pull.git
synced 2024-12-25 14:10:13 +01:00
c6a82a7ccd
* 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
19 lines
425 B
Bash
Executable File
19 lines
425 B
Bash
Executable File
#!/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
|