I created a nice little command to measure data bandwidth consumption over a metered connection (excluding local traffic):
sudo iftop -i enp1s0 -f 'not (src net (10 or 172.16/12 or 192.168/16) and dst net (10 or 172.16/12 or 192.168/16))' -t -L1 2> /dev/null | awk '$1 == "Cumulative" {print $5 ;}'
If you give it some time you will see it will start printing lines with data in bytes (stdout I guess)..
I have tried many things trying to write these lines to a file including several variations of 1>, >, >>, tee and more.. Nothing seems to work, on redirecting output from awk.