[wpkg-users] Log Files

heiko.helmle at horiba.com heiko.helmle at horiba.com
Tue Nov 27 08:24:57 CET 2012


> 
> ..., because there is always something missing from the log on the 
> server, if it is done by a package.
> 
> It is best to do it after WPKG.js is called, which can be accomplished 
> by a post action in WPKG client or a line in the batch file executing 
> WPKG.js


I've done this inside of WPKG - the trick is to spawn the package process 
(on execute='changed' in my case), let wpkg continue and the spawned 
process waits for wpkg to end and only then touches the log

this combination will ftp the log to the server only if an error is 
logged:

<package id='reporterror'
        name='Report Packaging Errors'
        revision='4'
        priority='0'
        execute='changed'>
 
 
        <install cmd='"%TOOLDIR%\curl.exe" -f -s 
http://wpkg/wpkg/scripts/reporterrors.cmd -o 
"%TOOLDIR%\reporterrors.cmd"'>
                <condition>
                        <check type='logical' condition='not'>
                                <check type='file' condition='sizeequals' 
path='%TOOLDIR%\reporterrors.cmd' value='324' />
                        </check>
                </condition>
        </install>
 
        <install cmd='"%COMSPEC%" /C start "reporterrors" "%COMSPEC%" /C 
"%TOOLDIR%\reporterrors.cmd"'/>

        <upgrade include='install'/>
</package>

with reporterrors.cmd being this:
---
goto test
:wait
ping localhost
:test
reg query HKEY_LOCAL_MACHINE\SOFTWARE\WPKG /v running | find "true"
if %ERRORLEVEL% EQU 0 goto wait

FIND "ERROR" "%TEMP%\wpkg-%COMPUTERNAME%.log"
if %ERRORLEVEL% NEQ 0 goto end

"%~dp0\curl.exe" -f -s ftp://wpkg/wpkg-log/ -T 
"%TEMP%\wpkg-%COMPUTERNAME%.log"

:end
---

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20121127/04f69de9/attachment-0002.html>


More information about the wpkg-users mailing list