Add partial bootstrapping
This commit is contained in:
parent
a397495ad8
commit
f9b3f450bb
|
@ -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..."
|
||||
|
|
Loading…
Reference in New Issue