@echo OFF
if not '%1'=='' GOTO SETDATE
: i=dayofwkstr, j=month, k=day, l=year
FOR /F "tokens=1-4 delims=/ " %%i IN ('DATE /T') DO SET DateStr=%%l%%j%%k
for /F "tokens=1-2 delims=: " %%i IN ('time /T') DO SET TimeStr=%%i%%j
GOTO AFTERSETDATE
:SETDATE
SET DateStr=%1
:AFTERSETDATE
echo %DateStr%
echo %TimeStr%
@echo on
SET SRV_NAME=%COMPUTERNAME%
del \\%SRV_NAME%\d$\Gpro-logs- tables\*.* /Q /S /F
:server side
xcopy \\WTPCPAPGT303\inforeach\ inforeach\out\*.* /S \\%SRV_NAME%\d$\Gpro-logs- tables\ServerSide\AP303
xcopy \\WTPCPAPGT301\d$\inforeach\ inforeach\out\*.* /S \\%SRV_NAME%\d$\Gpro-logs- tables\ServerSide\AP301
:Gpro.log
xcopy \\WTPCPAPGT303\c$\temp\gpro. log \\%SRV_NAME%\d$\Gpro-logs- tables\ServerSide\AP303
xcopy \\WTPCPAPGT301\c$\temp\gpro. log \\%SRV_NAME%\d$\Gpro-logs- tables\ServerSide\AP301
:djwin.log
xcopy \\WTPCPAPGT303\c$\temp\djwin. log \\%SRV_NAME%\d$\Gpro-logs- tables\ServerSide\AP303
:DJExporter.txt
xcopy \\WTPCPAPGT303\c$\temp\ DJExporter.txt \\%SRV_NAME%\d$\Gpro-logs- tables\ServerSide\AP303
:ClientInfo.txt
xcopy \\WTPCPAPGT301\c$\temp\ ClientInfo.txt \\%SRV_NAME%\d$\Gpro-logs- tables\ServerSide\AP301
:client side
xcopy \\WTPCPCXGT001\e$\inforeach\ inforeach\out\*.* /S \\%SRV_NAME%\d$\Gpro-logs- tables\ClientSide\CTX1
xcopy \\WTPCPCXGT001\c$\temp\gpro. log \\%SRV_NAME%\d$\Gpro-logs- tables\ClientSide\CTX1
xcopy \\WTPCPCXGT002\e$\inforeach\ inforeach\out\*.* /S \\%SRV_NAME%\d$\Gpro-logs- tables\ClientSide\CTX2
xcopy \\WTPCPCXGT002\c$\temp\gpro. log \\%SRV_NAME%\d$\Gpro-logs- tables\ClientSide\CTX2
xcopy \\WTPCPCXGT003\e$\inforeach\ inforeach\out\*.* /S \\%SRV_NAME%\d$\Gpro-logs- tables\ClientSide\CTX3
xcopy \\WTPCPCXGT003\c$\temp\gpro. log \\%SRV_NAME%\d$\Gpro-logs- tables\ClientSide\CTX3
xcopy \\WTPCPCXGT004\e$\inforeach\ inforeach\out\*.* /S \\%SRV_NAME%\d$\Gpro-logs- tables\ClientSide\CTX4
xcopy \\WTPCPCXGT004\c$\temp\gpro. log \\%SRV_NAME%\d$\Gpro-logs- tables\ClientSide\CTX4
:BCP out the GP_ tables
isqlw -i\\WTPCPDBGT301\e$\ GProProduction\Daily\sql\GP_ Tables_bcp_new.sql -o\\WTPCPDBGT301\e$\ GProProduction\Daily\Logs\GP_ Tables_bcp.out -E
call wzzip.exe -rp \\%SRV_NAME%\d$\Gpro-logs- tables\%DateStr%%TimeStr%Gpro_ Logs_Tables \\%SRV_NAME%\d$\Gpro-logs- tables\
copy \\%SRV_NAME%\d$\Gpro-logs- tables\%DateStr%%TimeStr%Gpro_ Logs_Tables.zip \\%SRV_NAME%\E$\ GProProduction\Logs-Archive\
@ECHO on
SET PROCESS=GETFILE
SET CMDFILE=INFOREACH_FTP.FTP
SET LOGFILE=INFOREACH_FTP.LOG
SET LOCAL_DATA=D:\Gpro-logs-tables
SET USERNAME=gpro@in4reach.com
SET PASSWORD=gpro01
SET HOSTNAME=www.in4reach.com
SET SERVICE=%1
Echo open %HOSTNAME% > %CMDFILE%
Echo %USERNAME%>> %CMDFILE%
Echo %PASSWORD%>> %CMDFILE%
Echo lcd %LOCAL_DATA% >> %CMDFILE%
Echo bin >> %CMDFILE%
Echo hash >> %CMDFILE%
Echo put %DateStr%%TimeStr%Gpro_Logs_ Tables.zip >> %CMDFILE%
Echo quit >> %CMDFILE%
@ECHO ON
ftp -v -s:%CMDFILE% > %LOGFILE%
No comments:
Post a Comment