How to let mydumper piped to ssh?

From [URL]https://www.percona.com/blog/2015/07/23/the-qa-creating-best-in-class-backup-solutions-for-your-mysql-environment/[/URL],Mydumper could be piped, but how to pipe mydumper with ssh?

For SSH you can do from source host:

shell> cd /path/to/backupdir
shell> mydumper -u user -p password -c -o ./ | tar -zcf -./ | ssh user@destination ‘cat - > /path/to/desthost/backupdir/backup.tar.gz’

You can also use netcat with:

Destination host:

shell> cd /path/to/backupdir
shell> nc -l 9999 | tar zxf - > ./backup.tar.gz

Source host:

shell> cd /path/to/backupdir
shell> mydumper -u user -p password -c -o ./ | tar -zcf - ./ | nc destination_host 9999

Thank you very much!

Only for people who come to this answer as I when checking if mydumper can be piped.
The above command line has nothing to do with mydumper piping!

It’s more a 2step version written in one line … and looks correct this way:

shell> /path/to/backupdir
shell> mydumper -u user -p password -c -o ./
shell> tar -zcf -./ | ssh user@destination ‘cat - > /path/to/desthost/backupdir/backup.tar.gz’

Bests