void-bash-installer/files/bin/void-snapshot

23 lines
464 B
Plaintext
Raw Normal View History

2021-04-15 10:27:27 +02:00
#!/bin/bash
if [ "${UID}" -ne "0" ]; then
echo "Keine Rootrechte."
exit 1
fi
if [ -f /etc/btrbk/btrbk.conf ]; then
cfg="/etc/btrbk/btrbk.conf"
else
cfg="/etc/btrbk/btrbk.conf.system"
fi
if mountpoint -q /var/lib/backup/quelle/bootfs; then
snapshotbootfs="snapshotbootfs"
fi
for s in snapshotrootfs "${snapshotbootfs}"; do
test "${s}" && btrbk --config="${cfg}" --quiet run "${s}"
done
if ! sudo update-grub 2> /dev/null; then
echo update-grub failed
fi