btrfish/utils.fish

23 lines
472 B
Fish
Raw Normal View History

2016-05-05 01:15:35 +02:00
#!/usr/bin/fish
2016-05-05 02:04:21 +02:00
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
2016-05-05 02:52:02 +02:00
function receive-on-target
ssh -i $sshkey $targetuser@$targethost sudo btrfs receive $targetpath
end
2016-05-05 02:04:21 +02:00
function get-subvol
echo $argv | cut -d' ' -f1
end
function get-mount
echo $argv | cut -d' ' -f2
2016-05-05 01:15:35 +02:00
end
function clean-name
echo $argv | sed 's/\//-/g'
end