The best way to manage this is with an open source ETL tool like CloverETL, Talend, Kettle, etc. If you want to manage this with shell scripts, look at the script I’ve contributed under the download button above under download contributed software. I have a script called ICE Breaker for MySQL that does this, takes a table from a remote MySQL schema and loads it into infobright. Feel free to take it in whole or in part to make it work for you. It assumes the table exists on the source and target systems.
http://www.infobright.org/Downloads/Contributed-Software/