mysqldump
mysqldump [OPTIONS] [DATABASE_NAME] [TABLE_NAME] | gzip -c | ssh -t [USER_NAME]@[HOST_NAME] “cat > /path/to/table.tgz”
예제1)
time mysqldump –single-transaction –quick zabbix | gzip -c | ssh -p22 genie@1.2.3.4 “cat > /tmp/zabbix.sql.gz”
예제2)
time mysqldump –single-transaction –quick –routines –opt —extended-insert –no-autocommit database table1 | gzip -c | ssh user@1.2.3.4 “cat > /path/to/databse-table1.sql.gz“
예제2-1) ServerB
gzip -d /path/to/databse-table1.sql.gz
mysql database < /path/to/databse-table1.sql