fix script
This commit is contained in:
parent
6134e20f77
commit
207a9678ca
1 changed files with 3 additions and 2 deletions
|
@ -13,6 +13,9 @@ timetoday="$(date "+%Y%m%d-%H%M%S")"
|
||||||
|
|
||||||
if [ "make" == "$1" ] || [ "add" == "$1" ] || [ "backup" == "$1" ] || [ "cp" == "$1" ] || [ "create" == "$1" ]; then
|
if [ "make" == "$1" ] || [ "add" == "$1" ] || [ "backup" == "$1" ] || [ "cp" == "$1" ] || [ "create" == "$1" ]; then
|
||||||
|
|
||||||
|
# Backup fstab
|
||||||
|
cp /etc/fstab /etc/fstab.backup
|
||||||
|
|
||||||
while (( "$(expr $# - 1)" ))
|
while (( "$(expr $# - 1)" ))
|
||||||
do
|
do
|
||||||
|
|
||||||
|
@ -21,8 +24,6 @@ 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
|
||||||
|
|
||||||
cp /etc/fstab /etc/fstab.backup
|
|
||||||
|
|
||||||
sed -i "s|__current/${pfad}|__snapshot/${pfad}@`head -n 1 /btrfs-root/__current/${pfad}/SNAPSHOT`|g;" /etc/fstab
|
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%/*}
|
||||||
|
|
Loading…
Reference in a new issue