tar -cf - -C /your/dir . | pv -s "$(du -s -b /your/dir | cut -f1)" | gzip --best --stdout - | SSHPASS="your password" sshpass -e ssh user@example.com 'cat > /home/user/output.tar.gz'