From 207a9678cab61c69c4b52b13fbba8dcfc820034c Mon Sep 17 00:00:00 2001 From: user1 Date: Thu, 30 Mar 2023 04:20:52 +0200 Subject: [PATCH] fix script --- scripts/snapshot.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/snapshot.sh b/scripts/snapshot.sh index 1d59aeb..dad2f37 100755 --- a/scripts/snapshot.sh +++ b/scripts/snapshot.sh @@ -13,6 +13,9 @@ timetoday="$(date "+%Y%m%d-%H%M%S")" if [ "make" == "$1" ] || [ "add" == "$1" ] || [ "backup" == "$1" ] || [ "cp" == "$1" ] || [ "create" == "$1" ]; then + # Backup fstab + cp /etc/fstab /etc/fstab.backup + while (( "$(expr $# - 1)" )) do @@ -20,8 +23,6 @@ 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