From f9b3f450bb7b727249f74b35298c44473f26a973 Mon Sep 17 00:00:00 2001 From: Les De Ridder Date: Mon, 23 May 2016 22:02:53 +0000 Subject: [PATCH] Add partial bootstrapping --- bootstrap.fish | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/bootstrap.fish b/bootstrap.fish index a71b416..8c75e6d 100755 --- a/bootstrap.fish +++ b/bootstrap.fish @@ -6,13 +6,13 @@ source $scriptdir/config.fish source $scriptdir/utils.fish if test -d $subvoldir - echo "Backup directory already exists, aborting..." - exit + echo "Warning: backup directory already exists." + echo "Existing subvolumes won't be overwritten." +else + echo "Creating subvolume directory..." + mkdir $subvoldir end -echo "Creating subvolume directory..." -mkdir $subvoldir - echo "Creating initial snapshots..." for pair in (get-subvol-mounts) set subvol (get-subvol $pair) @@ -21,9 +21,10 @@ for pair in (get-subvol-mounts) set safename (clean-name $subvol) set safepath $subvoldir/$safename - sudo btrfs subvolume snapshot -r $mount $safepath - - set snapshots $snapshots $safepath + if not test -d $safepath + sudo btrfs subvolume snapshot -r $mount $safepath + set snapshots $snapshots $safepath + end end echo "Syncing..."