Buy Percona ServicesBuy Now!

How to let mydumper piped to ssh?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to let mydumper piped to ssh?

    From https://www.percona.com/blog/2015/07...l-environment/,Mydumper could be piped, but how to pipe mydumper with ssh?

  • #2
    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

    Comment


    • #3
      Originally posted by jrivera View Post
      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!
      Last edited by leafonsword; 07-27-2015, 09:15 PM.

      Comment


      • #4
        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

        Comment

        Working...
        X