I want to calculate the size of btrfs send stream in order to take an appropriate action.
For now, I can get the size with the following code:
exec 5>&1 size=$(btrfs send -v -p $ref_snapshot $src | pv -f 2>&1 > /dev/null | tee >(cat - >&5) ) echo "Calculated size is: $(echo $size | awk '{print $1}')" Problem is that this process take too long (32 minutes for 119GiB, for example), so it can't be considered useful.
Is there any way to get the stream size (or a close estimation) in a quicker way?