@echo on

echo backup begin...

if exist .\backup\ rmdir /s/q .\backup\
mkdir .\backup\
if not exist .\backup_jar\ mkdir .\backup_jar\
if exist .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\ (
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\atic.cbb.ireport-0.0.1-SNAPSHOT.jar .\backup\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\atic.ireport.adapter-0.0.1-SNAPSHOT.jar .\backup\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.auth.encrypt-0.0.1-SNAPSHOT.jar .\backup\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.cloudclean-0.0.1-SNAPSHOT.jar .\backup\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.dashboard-0.0.1-SNAPSHOT.jar .\backup\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.diversion-0.0.1-SNAPSHOT.jar .\backup\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.fault-0.0.1-SNAPSHOT.jar .\backup\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.internal-0.0.1-SNAPSHOT.jar .\backup\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.log-0.0.1-SNAPSHOT.jar .\backup\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.neglobal-0.0.1-SNAPSHOT.jar .\backup\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.packetcapture-0.0.1-SNAPSHOT.jar .\backup\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.policy-0.0.1-SNAPSHOT.jar .\backup\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.report-0.0.1-SNAPSHOT.jar .\backup\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.secne-0.0.1-SNAPSHOT.jar .\backup\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.server-0.0.1-SNAPSHOT.jar .\backup\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.core.base-0.0.1-SNAPSHOT.jar .\backup\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.core.log-0.0.1-SNAPSHOT.jar .\backup\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.system.common-0.0.1-SNAPSHOT.jar .\backup\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.system.dump-0.0.1-SNAPSHOT.jar .\backup\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.unicom.soc-0.0.1-SNAPSHOT.jar .\backup\
	if exist .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\xmlschema-core-2.2.4.jar (
		copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\xmlschema-core-2.2.4.jar .\backup_jar\
	)
	if exist .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\javax.annotation-api-1.3.1.jar (
		copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\javax.annotation-api-1.3.1.jar .\backup_jar\
	)
	if exist .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\cxf-core-3.3.1.jar (
		copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\cxf-core-3.3.1.jar .\backup_jar\
	)
	if exist .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\cxf-rt-frontend-jaxrs-3.3.1.jar (
		copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\cxf-rt-frontend-jaxrs-3.3.1.jar .\backup_jar\
	)
	if exist .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\cxf-rt-transports-http-3.3.1.jar (
		copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\cxf-rt-transports-http-3.3.1.jar .\backup_jar\
	)
)
if exist .\..\Runtime\vsm_conf\antiddos\attackIpConfig.xml (
	copy /Y .\..\Runtime\vsm_conf\antiddos\attackIpConfig.xml .\backup\
)
if exist .\..\Runtime\vsm_conf\antiddos\unicom\unicom.xml (
	copy /Y .\..\Runtime\vsm_conf\antiddos\unicom\unicom.xml .\backup\
)
if exist .\..\Runtime\LegoRuntime\conf\ (
	mkdir .\backup\LegoRuntime\
	copy /Y .\..\Runtime\LegoRuntime\conf\version.txt .\backup\LegoRuntime\
)
if exist .\..\antiddos_collector\conf\ (
	mkdir .\backup\antiddos_collector\
	copy /Y .\..\antiddos_collector\conf\version.txt .\backup\antiddos_collector\
)
if exist .\..\Runtime\Tomcat6\Lego-UI-Plat\help\ (
	xcopy /Y /E /Q .\..\Runtime\Tomcat6\Lego-UI-Plat\help .\backup\help\ >nul
)
if exist .\..\antiddos_collector\lib\ (
	copy /Y .\..\antiddos_collector\lib\com.huawei.atic.collector-0.0.1-SNAPSHOT.jar .\backup\
)
if exist .\..\vsm_ha_server\lib\ (
	copy /Y .\..\vsm_ha_server\lib\ha.jar .\backup\
)
if exist .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\config\spring\ (
	mkdir .\backup\spring\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\config\spring\applicationContext.xml .\backup\spring\
	copy /Y .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\config\spring\applicationContext-Restful.xml .\backup\spring\
)
if exist .\..\Runtime\Tomcat6\Lego-UI-Plat\iReport\iReportBiz\reportPlugins\ (
	mkdir .\backup\reportPlugins\
	xcopy /Y /E /Q .\..\Runtime\Tomcat6\Lego-UI-Plat\iReport\iReportBiz\reportPlugins .\backup\reportPlugins\ >nul
)
if exist .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\pages\iReport\reportui\report\ (
	mkdir .\backup\report\
	xcopy /Y /E /Q .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\pages\iReport\reportui\report .\backup\report\ >nul
)
if exist .\..\Runtime\Tomcat6\webapps\portal\ (
	mkdir .\backup\portal\
	xcopy /Y /E /Q .\..\Runtime\Tomcat6\webapps\portal .\backup\portal\ >nul
)
if exist .\..\vsm_ha_server\ (
	mkdir .\backup\vsm_ha_server\
	copy /Y .\..\vsm_ha_server\VSMHAService.bat .\backup\vsm_ha_server\
)

echo backup finished.

@echo off

