CPUG

The Check Point User Group

A Resource For The Check Point Community.  Fast.  Useful.  Independent.

1. CCSA/CCSE One-Week Dual-Certification Training Course with CPUG in San Francisco!
    Courses Starting 12/8, (2009) 1/19, 2/9, 3/9, 4/6, 5/4, 6/8, 7/6, 8/3.
2. Join Us On LinkedIn - We now have a CPUG group.


Go Back   CPUG: The Check Point User Group > Check Point Firewall-1/VPN-1 And Related Products > SmartCenter Server (Formerly Management Server)
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2007-12-18
Junior Member
 
Join Date: 2006-12-13
Posts: 9
Rep Power: 0
truerelaxation has an average reputation (10+)
Default Delete log files every 90 days

I would like to keep the log files on my SecurePlatform NGX R65 SmartCenter Server that are less than 90 days. I'd like to run a cron job to delete anything older than 90 days nightly. Can anyone tell me the best way to do this?

I currently do a log switch at midnight every night. I have one log file per day.

Thanks,
TR
Reply With Quote
  #2 (permalink)  
Old 2007-12-18
Junior Member
 
Join Date: 2006-06-02
Posts: 24
Rep Power: 0
rugby1725 has an average reputation (10+)
Default Re: Delete log files every 90 days

I do it on Solaris but the command should be more or less the same.

find $FWDIR/log -mtime +90 | xargs rm

Basically what this says is find any file in the log directory that hasn't been touched in 90 days and delete it. If you're concerned about some of the standard files in there that may get deleted by accident add a -name qualifier.

IE
find $FWDIR/log -mtime +90 -name "*.bz2" | xargs rm

This will do the same as above but will only delete files that end in .bz2

Also, keep in mind that if you have symlinked your log directory to a different directory you will need to put in the actual path not the Checkpoint one.
Reply With Quote
  #3 (permalink)  
Old 2008-01-02
Junior Member
 
Join Date: 2006-12-13
Posts: 9
Rep Power: 0
truerelaxation has an average reputation (10+)
Default Re: Delete log files every 90 days

Thank you for the reply. This is just what I needed.

Can anyone tell me how I would write a cron job to do this? I believe that I put the command in some type of file then schedule it using crontab. I'm a little fuzzy on what the file with the commands would look like.

Thanks,
Paul
Reply With Quote
  #4 (permalink)  
Old 2008-01-14
Senior Member
 
Join Date: 2007-06-05
Location: Canada
Posts: 183
Rep Power: 2
hotice_ has an average reputation (10+)
Default Re: Delete log files every 90 days

crontab -e to edit the crontab file (SPLAT)


to edit the file
google up the required arguments...i never remember the correct order you need to set
Reply With Quote
  #5 (permalink)  
Old 2008-01-15
Junior Member
 
Join Date: 2006-12-13
Posts: 9
Rep Power: 0
truerelaxation has an average reputation (10+)
Default Re: Delete log files every 90 days

I got this working. Thanks for the help.
Reply With Quote
  #6 (permalink)  
Old 2008-03-03
Member
 
Join Date: 2006-04-05
Posts: 86
Rep Power: 3
gladiatorkev has an average reputation (10+)
Default Re: Delete log files every 90 days

Can anyone guide me as to how the same can be done on a Smartcentre server installed on WIN2K3..?!


Appreciate the inputs.

Thanks
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -7. The time now is 01:23.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0