#!/usr/bin/fish function get-subvol-mounts #cat /etc/fstab | grep subvol | sed 's/.*subvol=//;s/)//;s/\t\| \|0//g' cat /etc/fstab | grep btrfs | cut -d\t -f2,4 | sed 's/\(.*\)\t.*,subvol=\(.*\)$/\2 \1/' end function receive-on-target ssh -i $sshkey $targetuser@$targethost sudo btrfs receive $targetpath end function get-subvol echo $argv | cut -d' ' -f1 end function get-mount echo $argv | cut -d' ' -f2 end function clean-name echo $argv | sed 's/\//-/g' end