| CPUG | |
| The Check Point User Group | |
| A Resource For The Check Point Community. Fast. Useful. Independent. | |
|
| |||||||
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
| 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 |
| |||
| 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. |
| |||
| 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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |