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