Not the answer you need?
Register and ask your own question!

How to let mydumper piped to ssh?

leafonswordleafonsword ContributorInactive User Role Beginner

Comments

  • jriverajrivera Percona Support Engineer Percona Staff Role
    For SSH you can do from source host:

    shell> cd /path/to/backupdir
    shell> mydumper -u user -p password -c -o ./ | tar -zcf -./ | ssh [email protected] '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
  • leafonswordleafonsword Contributor Inactive User Role Beginner
    jrivera wrote: »
    For SSH you can do from source host:

    shell> cd /path/to/backupdir
    shell> mydumper -u user -p password -c -o ./ | tar -zcf -./ | ssh [email protected] '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!
  • Reiner030Reiner030 Entrant Current User Role Beginner
    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 [email protected] 'cat - > /path/to/desthost/backupdir/backup.tar.gz'

    Bests
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.