fixes and additions

This commit is contained in:
teldra 2021-04-12 17:25:50 +02:00
parent 16494e168c
commit f6f0bfd115
4 changed files with 52 additions and 46 deletions

View File

@ -82,52 +82,49 @@ if [[ ! ${cfg[fde_key_store]} == "none" ]]; then
echo "fi" >> /etc/runit/core-services/99-changepwuser.sh
fi
mkdir -p /var/lib/backup/quelle/{rootfs,home}
echo "transaction_log /var/log/btrbk.log" > /etc/btrbk/btrbk.conf
echo "lockfile /tmp/btrbk.lock" >> /etc/btrbk/btrbk.conf
echo "incremental yes" >> /etc/btrbk/btrbk.conf
echo "btrfs_commit_delete after" >> /etc/btrbk/btrbk.conf
echo "timestamp_format long" >> /etc/btrbk/btrbk.conf
echo "noauto yes" >> /etc/btrbk/btrbk.conf
{ echo "transaction_log /var/log/btrbk.log";
echo "lockfile /tmp/btrbk.lock";
echo "incremental yes";
echo "btrfs_commit_delete after";
echo "timestamp_format long";
echo "noauto yes"; } > /etc/btrbk/btrbk.conf
if [[ ! ${cfg[fde_key_store]} == "once" ]]; then
mkdir -p /var/lib/backup/quelle/boot
echo "volume /var/lib/backup/quelle/boot" >> /etc/btrbk/btrbk.conf
echo " group snapshot all" >> /etc/btrbk/btrbk.conf
echo " snapshot_dir snapshot" >> /etc/btrbk/btrbk.conf
echo " snapshot_preserve_min 4h" >> /etc/btrbk/btrbk.conf
echo " snapshot_preserve no" >> /etc/btrbk/btrbk.conf
echo " subvolume void" >> /etc/btrbk/btrbk.conf
{ echo "volume /var/lib/backup/quelle/boot";
echo " group snapshot all";
echo " snapshot_dir snapshot";
echo " snapshot_preserve_min 4h";
echo " snapshot_preserve no";
echo " subvolume void"; } >> /etc/btrbk/btrbk.conf
fi
echo "volume /var/lib/backup/quelle/rootfs" >> /etc/btrbk/btrbk.conf
echo " group snapshot all" >> /etc/btrbk/btrbk.conf
echo " snapshot_dir snapshot" >> /etc/btrbk/btrbk.conf
echo " snapshot_preserve_min 4h" >> /etc/btrbk/btrbk.conf
echo " snapshot_preserve no " >> /etc/btrbk/btrbk.conf
echo " subvolume void-rootfs" >> /etc/btrbk/btrbk.conf
echo " subvolume home" >> /etc/btrbk/btrbk.conf
{ echo "volume /var/lib/backup/quelle/rootfs";
echo " group snapshot all";
echo " snapshot_dir snapshot";
echo " snapshot_preserve_min 4h";
echo " snapshot_preserve no ";
echo " subvolume void-rootfs";
echo " subvolume home"; } >> /etc/btrbk/btrbk.conf
if [[ ! ${cfg[fde_key_store]} == "once" ]]; then
mkdir -p /var/lib/backup/ziel/void
echo "volume /var/lib/backup/quelle/boot" >> /etc/btrbk/btrbk.conf
echo " group backup all" >> /etc/btrbk/btrbk.conf
echo " snapshot_dir backup" >> /etc/btrbk/btrbk.conf
echo " snapshot_preserve_min 4h" >> /etc/btrbk/btrbk.conf
echo " snapshot_preserve no" >> /etc/btrbk/btrbk.conf
echo " target_preserve_min latest" >> /etc/btrbk/btrbk.conf
echo " target_preserve 20d 10w 2m" >> /etc/btrbk/btrbk.conf
echo " subvolume void" >> /etc/btrbk/btrbk.conf
echo " target send-receive /var/lib/backup/ziel/void/boot" >> /etc/btrbk/btrbk.conf
{ echo "volume /var/lib/backup/quelle/boot";
echo " group backup all";
echo " snapshot_dir backup";
echo " snapshot_preserve_min 4h";
echo " snapshot_preserve no";
echo " target_preserve_min latest";
echo " target_preserve 20d 10w 2m";
echo " subvolume void";
echo " target send-receive /var/lib/backup/ziel/void/boot"; } >> /etc/btrbk/btrbk.conf
fi
echo "volume /var/lib/backup/quelle/rootfs" >> /etc/btrbk/btrbk.conf
echo " group backup all" >> /etc/btrbk/btrbk.conf
echo " snapshot_dir backup" >> /etc/btrbk/btrbk.conf
echo " snapshot_preserve_min 4h" >> /etc/btrbk/btrbk.conf
echo " snapshot_preserve no" >> /etc/btrbk/btrbk.conf
echo " target_preserve_min latest" >> /etc/btrbk/btrbk.conf
echo " target_preserve 20d 10w 2m" >> /etc/btrbk/btrbk.conf
echo " subvolume rootfs" >> /etc/btrbk/btrbk.conf
echo " target send-receive /var/lib/backup/ziel/void/rootfs" >> /etc/btrbk/btrbk.conf
echo " subvolume home" >> /etc/btrbk/btrbk.conf
echo " target send-receive /var/lib/backup/ziel/void/homefs" >> /etc/btrbk/btrbk.conf
{ echo "volume /var/lib/backup/quelle/rootfs";
echo " group backup all";
echo " snapshot_dir backup";
echo " snapshot_preserve_min 4h";
echo " snapshot_preserve no";
echo " target_preserve_min latest";
echo " target_preserve 20d 10w 2m";
echo " subvolume rootfs";
echo " target send-receive /var/lib/backup/ziel/void/rootfs";
echo " subvolume home";
echo " target send-receive /var/lib/backup/ziel/void/homefs"; } >> /etc/btrbk/btrbk.conf
mkdir -p /var/spool/cron/
echo "0 */2 * * * /usr/bin/btrbk -q run snapshot" >> /var/spool/cron/root

View File

@ -12,7 +12,7 @@ if [[ "${cfg[de]}" == "gnome" ]]; then
addpkg "${cfg[dm]}" "gnome" "seahorse" "seahorse-nautilus" "evince"
elif [[ "${cfg[de]}" == "kde5" ]]; then
setconf add "dm" "sddm"
addpkg "${cfg[dm]}" kde5 kde5-baseapps kdegraphics-thumbnailers ffmpegthumbs ark gwenview kmail okular spectacle kalarm kcalc print-manager
addpkg "${cfg[dm]}" kde5 kde5-baseapps kdegraphics-thumbnailers ffmpegthumbs ark gwenview kmail okular spectacle kalarm kcalc print-manager plasma-browser-integration kwalletmanager
elif [[ "${cfg[de]}" == "i3wm" ]]; then
setconf add "dm" "lightdm"
addpkg lightdm lightdm-gtk3-greeter i3-gaps i3lock-color i3status xfce4-terminal dmenu rofi pcmanfm dunst elogind gvfs gvfs-afc gvfs-afp gvfs-cdda paprefs pavucontrol gvfs-gphoto2 gvfs-mtp gvfs-smb xss-lock claws-mail galculator-gtk3

View File

@ -101,12 +101,16 @@ mkdir -p "${dest}/snapshot" "${dest}/backup"
umount "${dest}"
mount "/dev/mapper/voidvg.${diskid}-root" "${dest}" -o subvol=void-rootfs
for i in boot home dev proc sys tmp etc var/lib/backup/quelle/rootfs var/db; do mkdir -p "${dest}/${i}"; done
for i in boot home dev proc sys tmp etc var/lib/backup/quelle/rootfs var/lib/backup/ziel var/db; do mkdir -p "${dest}/${i}"; done
mount "/dev/mapper/voidvg.${diskid}-root" "${dest}"/home -o subvol=home
if [[ "${cfg[fde_key_store]}" == "once" ]]; then
mkdir -p "${dest}/var/lib/backup/quelle/boot"
mkfs.btrfs -q -f "${target_boot}"
mount "${target_boot}" "${dest}/boot"
btrfs subvol create "${dest}/boot/void"
mkdir -p "${dest}/boot/snapshot" "${dest}/boot/backup"
umount "${dest}/boot"
mount "${target_boot}" "${dest}/boot" -o subvol=void
fi
for dir in dev proc sys run; do mkdir -p "${dest}"/$dir ; mount --rbind /$dir "${dest}"/$dir ; mount --make-rslave "${dest}"/$dir ; done

View File

@ -97,15 +97,20 @@ mkswap "/dev/mapper/voidvg.${diskid}-swap"
mount "/dev/mapper/voidvg.${diskid}-root" "${dest}"
btrfs subvol create "${dest}/void-rootfs"
btrfs subvol create "${dest}/home"
mkdir -p "${dest}/snapshot"
mkdir -p "${dest}/snapshot" "${dest}/backup"
umount "${dest}"
mount "/dev/mapper/voidvg.${diskid}-root" "${dest}" -o subvol=void-rootfs
for i in boot home dev proc sys tmp etc var/lib/backup/quelle var/db; do mkdir -p "${dest}/${i}"; done
for i in boot home dev proc sys tmp etc var/lib/backup/quelle/rootfs var/lib/backup/ziel var/db; do mkdir -p "${dest}/${i}"; done
mount "/dev/mapper/voidvg.${diskid}-root" "${dest}"/home -o subvol=home
if [[ "${cfg[fde_key_store]}" == "once" ]]; then
mkdir -p "${dest}/var/lib/backup/quelle/boot"
mkfs.btrfs -q -f "${target_boot}"
mount "${target_boot}" "${dest}/boot"
btrfs subvol create "${dest}/boot/void"
mkdir -p "${dest}/boot/snapshot" "${dest}/boot/backup"
umount "${dest}/boot"
mount "${target_boot}" "${dest}/boot" -o subvol=void
fi
for dir in dev proc sys run; do mkdir -p "${dest}"/$dir ; mount --rbind /$dir "${dest}"/$dir ; mount --make-rslave "${dest}"/$dir ; done