Posts Tagged ‘code’

online inventory replication batch program update

Thursday, September 7th, 2006

The Boxcar online inventory replication program wrapper batch file wasn’t working right because the SSH tunnel to the MySQL server kept dying. So, I modified the wrapper to test to make sure the server was up and then restart the service if it’s not before running the replication. The code looks like this:

mysql --user=*** --password=*** --batch --execute="SELECT value FROM online_status WHERE config = 'online'" boxcar_mirror
IF NOT %ERRORLEVEL% NEQ 0 GOTO REP
net stop "MySQLTunnel"
net start "MySQLTunnel"
:REP
cd "C:\Documents and Settings\n\Desktop\inventory and sales\online stuff\"
.\BoxcarReplicator
.\shutdown -u