1

Closed

Zip collected log files and clean up

description

Added 7-zip (7z.exe) to the Tools directory to compress the log files in preparation for email.
After successfully compressing the logs, deleted the temporary log folder from the USB stick.
In our environment, the PC techs run this script, so I added an %EMAIL% variable to store the email address they should send the logs to.
 
ECHO.
ECHO ***************************************************************************
ECHO Data collection completed...Now zipping log directory...
ECHO ***************************************************************************
ECHO.
7z a -t7z -m0=lzma -mx=9 %LOGS%:\Livecap_%COMPUTERNAME%.7z %LOGS%:\Livecap_%COMPUTERNAME%*
 
if %ERRORLEVEL% == 0 GOTO Cleanup
 
ECHO.
ECHO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ECHO ! Zip procedure failed. !
ECHO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ECHO.
ECHO Please zip the %LOGS%:\Livecap_%COMPUTERNAME% folder and
ECHO email it to %EMAIL%
ECHO.
 
goto end
 
:Cleanup
ECHO.
ECHO ***************************************************************
ECHO Zip succeeded.
ECHO Removing %LOGS%:\Livecap_%COMPUTERNAME% directory
ECHO ***************************************************************
ECHO.
 
rmdir /s /q %LOGS%:\Livecap_%COMPUTERNAME%
 
ECHO.
ECHO ***************************************************************
ECHO MIR-ROR Done :-)
ECHO ***************************************************************
ECHO.
ECHO Log file zipped to %LOGS%:\Livecap_%COMPUTERNAME%.7z.
ECHO.
ECHO Please email this file to %EMAIL%
ECHO.
 
:end
 
pause
Closed Mar 22, 2012 at 6:13 AM by RussMcRee
Update included in 2.0 stable release.

comments