Add partial bootstrapping

This commit is contained in:
Les De Ridder 2016-05-23 22:02:53 +00:00
parent a397495ad8
commit f9b3f450bb
1 changed files with 9 additions and 8 deletions

View File

@ -6,12 +6,12 @@ source $scriptdir/config.fish
source $scriptdir/utils.fish
if test -d $subvoldir
echo "Backup directory already exists, aborting..."
exit
end
echo "Warning: backup directory already exists."
echo "Existing subvolumes won't be overwritten."
else
echo "Creating subvolume directory..."
mkdir $subvoldir
end
echo "Creating initial snapshots..."
for pair in (get-subvol-mounts)
@ -21,10 +21,11 @@ for pair in (get-subvol-mounts)
set safename (clean-name $subvol)
set safepath $subvoldir/$safename
if not test -d $safepath
sudo btrfs subvolume snapshot -r $mount $safepath
set snapshots $snapshots $safepath
end
end
echo "Syncing..."
sync