Search code examples
gnu-screennetcatpercona

how to execute innobackupex to be executed inside screen to transfer the data over the nc


I am using fabric tool to automate database export and import. I am using innoabackupex tool to do the work. I have a requirement to start the backup inside a screen as the backup is very large size (above 300G). So its a must for me to send the data over nc to make it fast. So i am using below screen command which is not working while using pipe to send the data over nc

screen -fn -t test innobackupex --stream=tar --tables-file=/backup/backup.txt /data/backups/full-backup | nc target-server-ip 6789

Note:I have nc listening on my remote host to get the compressed data.

Please let me know the correct screen parameter to be used to execute the command opening a screen and to be run inside it


Solution

  • I got it to work this way:

    screen -fn -t test /bin/bash -c "innobackupex --stream=tar \
      --tables-file=/backup/backup.txt /data/backups/full-backup \
    | nc target-server-ip 6789"