From 6134e20f77923aa08a2a7c08879bc6dde13bdd9d Mon Sep 17 00:00:00 2001 From: user1 Date: Thu, 30 Mar 2023 04:16:33 +0200 Subject: [PATCH] fix snapshot script --- arch-install.sh | 2 +- scripts/snapshot.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch-install.sh b/arch-install.sh index 70f1af2..f4d1fd9 100755 --- a/arch-install.sh +++ b/arch-install.sh @@ -712,7 +712,7 @@ function installation { fi #forbtrfssnapshots - cp ${mountpoint}/etc/fstab ${mountpoint}/etc/fstab.default + cp ${mountpoint}/etc/fstab ${mountpoint}/etc/fstab.backup } diff --git a/scripts/snapshot.sh b/scripts/snapshot.sh index c0db497..1d59aeb 100755 --- a/scripts/snapshot.sh +++ b/scripts/snapshot.sh @@ -20,8 +20,10 @@ if [ "make" == "$1" ] || [ "add" == "$1" ] || [ "backup" == "$1" ] || [ "cp" == echo "${timetoday}" > /btrfs-root/__current/${pfad}/SNAPSHOT echo "BACKUP" >> /btrfs-root/__current/${pfad}/SNAPSHOT + + cp /etc/fstab /etc/fstab.backup - sed -i "s|__current/${pfad}|__snapshot/${pfad}@`head -n 1 /btrfs-root/__current/${pfad}/SNAPSHOT`|g;" /etc/fstab.default + sed -i "s|__current/${pfad}|__snapshot/${pfad}@`head -n 1 /btrfs-root/__current/${pfad}/SNAPSHOT`|g;" /etc/fstab mkdir -p /btrfs-root/__snapshot/${pfad%/*} btrfs subvolume snapshot /btrfs-root/__current/${pfad} /btrfs-root/__snapshot/${pfad}@`head -n 1 /btrfs-root/__current/${pfad}/SNAPSHOT` @@ -36,7 +38,7 @@ if [ "make" == "$1" ] || [ "add" == "$1" ] || [ "backup" == "$1" ] || [ "cp" == done #reset-fstab - cp /etc/fstab /etc/fstab.default + cp /etc/fstab.backup /etc/fstab kernel="initramfs-linux.img" linuz="vmlinuz-linux"