***** Call this batch file LogRetrieve.bat
::
:: Run this batch file. It will call the second batch for each line, and execute based on vars 1-4.
::
@Echo off
cls
Echo.
Echo Setting Current directory to C:\ServerLogs
Echo.
c:
cd \ServerLogs
Echo.
Echo Write Start status to MasterLog
Echo.
Echo. >> MasterLog.txt
Echo Started log retrieve on; >> MasterLog.txt
Date /t >> MasterLog.txt
Time /t >> MasterLog.txt
Echo. >> MasterLog.txt
:: Batch ServerName Volume Directory File
Call LogRetrieveDetail.bat EM-SVR-01 vol1 arcserve ArcLog.log
Call LogRetrieveDetail.bat EM-SVR-02 vol1 arcserve ArcLog.log
Call LogRetrieveDetail.bat DB-SVR-01 vol1 arcserve ArcLog.log
Call LogRetrieveDetail.bat DS-SVR-01 vol1 arcserve ArcLog.log
Echo.
Echo Write Complete status to MasterLog
Echo.
Echo. >> MasterLog.txt
Echo Completed log retrieve on; >> MasterLog.txt
Date /t >> MasterLog.txt
Time /t >> MasterLog.txt
Echo. >> MasterLog.txt
***** Call this batch file LogRetrieveDetail.bat
::
:: This batch gets called from LogRetrieve.bat.
::
Echo.
Echo Running retrieve for server %1. Getting file %4
Echo Running retrieve for server %1. Getting file %4 >> MasterLog.txt
Echo.
if not exist \\%1\%2\%3\%4 Echo File or server not available %1-%2-%3-%4
if not exist \\%1\%2\%3\%4 Echo File or server not available %1-%2-%3-%4 >> MasterLog.txt
xcopy \\%1\%2\%3\%4 %1-%2-%3-%4
if not exist C:\ServerLogs\%1-%2-%3-%4 Echo File not copied error
if not exist C:\ServerLogs\%1-%2-%3-%4 Echo File not copied error >> MasterLog.txt