I have not run a Windows platform Check Point system in years.. But here is some stuff that can maybe get you started... Not sure if this works with your version or not, so some testing would be required. Perhaps someone here can take it and tweak it for ya..
Two scripts. The first one does a logswitch of your Firewall-1 logs, etc... And the second script is something I threw together real quick to zip and delete MySQL database backups.. Something totally not related to Firewall-1, but could be adapted do to the same.. The second script will require command line version of RAR.
Sorry I dont have time to provide more help with this.. Like said, maybe someone else can take this and run with it..
Code:
@echo off
:: ***********************************************************************
:: * FILENAME: fwlog.bat *
:: * PURPOSE: Switch Firewall-1 Logs and Export to ASCII Format *
:: * NEEDS: Administrator Permission to run FW.EXE Commands *
:: * AUTHOR: Greg Gibson *
:: * CREATED: December 12, 2001 *
:: ***********************************************************************
:: Make sure Command Extensions are enabled! (Requires NT or 2000)
::**************************************************************************************
setlocal enableextensions
:: This is the Firewall-1 Binary Directory! (Needed to Access FW.EXE)
::**************************************************************************************
set fwdir=%systemroot%\fw1\4.1\bin\
:: This is the Firewall-1 Log Directory! (Needed to Access Log Files for Logswitch)
::**************************************************************************************
set logsrc=%systemroot%\fw1\4.1\log\
:: This is where the Log Files will be Switched to and Later Exported to ASCII Output!
::**************************************************************************************
set logtarget=d:\Firewall-1 Logs\
:: This variable will be used to create the folders and filenames in Date Format!
::**************************************************************************************
for /f "tokens= 1,2,3,4 delims=/ " %%I in ('date /t') do set today=%%J-%%K-%%L
set outfile=%today%
:: Create a Folder with the Date as it's name on the D: Drive!
::**************************************************************************************
md "d:\Firewall-1 Logs\%outfile%"
:: Switch the Current Log Files to an Archived version!
::**************************************************************************************
%fwdir%fw.exe logswitch "%outfile%"
:: Export the Archived Logs to ASCII Format! (Delimiter is TAB must be in Quotes)
::**************************************************************************************
%fwdir%fw logexport -d " " -i "%outfile%.log" -o "%outfile%.lognew" -n
%fwdir%fw logexport -d " " -i "%outfile%.alog" -o "%outfile%.alognew" -n
:: Delete the Archived Log Files in the Source Directory!
::**************************************************************************************
del "%logsrc%%outfile%.alog"
del "%logsrc%%outfile%.alogptr"
del "%logsrc%%outfile%.log"
del "%logsrc%%outfile%.logptr"
:: Copy the Exported ASCII Log Files to the folder created above!
::**************************************************************************************
copy "%logsrc%%outfile%.*" "d:\Firewall-1 Logs\%outfile%"
:: Delete the Exported Log Files that remained in the Source Directory!
::**************************************************************************************
del "%logsrc%%outfile%.alognew"
del "%logsrc%%outfile%.lognew"
:: Rename the Log Files on the D: Drive to *.log!
::**************************************************************************************
ren "%logtarget%%outfile%\%outfile%.alognew" "%outfile%.alog"
ren "%logtarget%%outfile%\%outfile%.lognew" "%outfile%.log"
:: End Job! Code:
SET filename=filename.tmp
DIR /b *.sql >filename.tmp
FOR /f "tokens=*" %%a IN (%filename%) DO SET rarfile="%%a"
RAR a %rarfile%.rar -m5 %rarfile%
DEL %filename%
DEL %rarfile%
SET filname=
SET rarfile=