fix snapshot script
This commit is contained in:
parent
aa417dff32
commit
6134e20f77
2 changed files with 5 additions and 3 deletions
|
@ -712,7 +712,7 @@ function installation {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#forbtrfssnapshots
|
#forbtrfssnapshots
|
||||||
cp ${mountpoint}/etc/fstab ${mountpoint}/etc/fstab.default
|
cp ${mountpoint}/etc/fstab ${mountpoint}/etc/fstab.backup
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,9 @@ if [ "make" == "$1" ] || [ "add" == "$1" ] || [ "backup" == "$1" ] || [ "cp" ==
|
||||||
echo "${timetoday}" > /btrfs-root/__current/${pfad}/SNAPSHOT
|
echo "${timetoday}" > /btrfs-root/__current/${pfad}/SNAPSHOT
|
||||||
echo "BACKUP" >> /btrfs-root/__current/${pfad}/SNAPSHOT
|
echo "BACKUP" >> /btrfs-root/__current/${pfad}/SNAPSHOT
|
||||||
|
|
||||||
sed -i "s|__current/${pfad}|__snapshot/${pfad}@`head -n 1 /btrfs-root/__current/${pfad}/SNAPSHOT`|g;" /etc/fstab.default
|
cp /etc/fstab /etc/fstab.backup
|
||||||
|
|
||||||
|
sed -i "s|__current/${pfad}|__snapshot/${pfad}@`head -n 1 /btrfs-root/__current/${pfad}/SNAPSHOT`|g;" /etc/fstab
|
||||||
|
|
||||||
mkdir -p /btrfs-root/__snapshot/${pfad%/*}
|
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`
|
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
|
done
|
||||||
|
|
||||||
#reset-fstab
|
#reset-fstab
|
||||||
cp /etc/fstab /etc/fstab.default
|
cp /etc/fstab.backup /etc/fstab
|
||||||
|
|
||||||
kernel="initramfs-linux.img"
|
kernel="initramfs-linux.img"
|
||||||
linuz="vmlinuz-linux"
|
linuz="vmlinuz-linux"
|
||||||
|
|
Loading…
Reference in a new issue