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..."