Link to home
Start Free TrialLog in
Avatar of bcrawley01
bcrawley01

asked on

Tool to move, compress, delete web logs

Hi,

Does anyone know any good free / open source tools that will move, compress and delete web logs when scheduled to do so?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of tanujchandna
tanujchandna
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of James Murrell
we use a vbs script and then sftp them to us..

we use the command options in 7z (better compression that winzip) http://www.7-zip.org/

below is batch file to backup and the delete vbs file to delete

(its up to you how you get them back to you)

regards James
--- bat file

@echo off

setlocal


for /F "tokens=2-4 delims=/ " %%f in ('date /t') do (
 set mm=%%f
 set dd=%%g
 set yyyy=%%h
)

REM Substract your 1 day here
set /A dd=1%dd% - 100 - 1
set /A mm=1%mm% - 100 + 0

if /I %dd% GTR 0 goto DONE

set /A mm=%mm% - 1

if /I %mm% GTR 0 goto ADJUSTDAY

set /A mm=12
set /A yyyy=%yyyy% - 1

:ADJUSTDAY

if %mm%==1 goto SET31
if %mm%==2 goto LEAPCHK
if %mm%==3 goto SET31
if %mm%==4 goto SET30
if %mm%==5 goto SET31
if %mm%==6 goto SET30
if %mm%==7 goto SET31
if %mm%==8 goto SET31
if %mm%==9 goto SET30
if %mm%==10 goto SET31
if %mm%==11 goto SET30
if %mm%==12 goto SET31

goto ERROR

:SET31

set /A dd=31 + %dd%

goto DONE

:SET30

set /A dd=30 + %dd%

goto DONE

:LEAPCHK

set /A tt=%yyyy% %% 4

if not %tt%==0 goto SET28

set /A tt=%yyyy% %% 100

if not %tt%==0 goto SET29

set /A tt=%yyyy% %% 400

if %tt%==0 goto SET29

:SET28

set /A dd=28 + %dd%

goto DONE

:SET29

set /A dd=29 + %dd%

:DONE


C:\7z\7za a -mx1 -r -ms=off E:\backuplocationfolder\IIS_log_files_%COMPUTERNAME%_%date:~0,2%-%date:~3,2%-%date:~6,6%_logfiles.7z E:\logfiles\*.*
c:\deletelog.vbs

:EXIT

------new file called deletelog.vbs

Dim fso: Set fso = CreateObject("Scripting.FileSystemObject")
 
Set objFolder = fso.GetFolder("E:\logfiles\")
 
for each file in objFolder.Files
        
        If DateDiff("d", file.DateLastModified, Date) > 1 Then
                fso.DeleteFile(file.Path)
        End If
        
next

Open in new window

Avatar of bcrawley01
bcrawley01

ASKER

Appears to be no tools available