Difference between revisions of "Deleting logs older than nnn days"

From Tech-Wiki
Jump to: navigation, search
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
In order to delete log files older than one year (you can adjust this value below) just edit your crontab and add:
+
[[Category:Check Point]]
 +
'''[[Check Point#Secure Platform|Back to Secure Platform]]'''
 +
 
 +
 
 +
In order to avoid running out of disk space, you can set to delete log files older than one year (you can adjust this value below) just edit your crontab and add:
  
 
  0 0 1 1 *  find $FWDIR/log/ -mtime +365 -exec rm -f {} \;
 
  0 0 1 1 *  find $FWDIR/log/ -mtime +365 -exec rm -f {} \;
  
 
This way, on January 1st, it will delete the files from the previous year (not the one that has just ended :)
 
This way, on January 1st, it will delete the files from the previous year (not the one that has just ended :)

Latest revision as of 06:14, 22 July 2016

Back to Secure Platform


In order to avoid running out of disk space, you can set to delete log files older than one year (you can adjust this value below) just edit your crontab and add:

0 0 1 1 *   find $FWDIR/log/ -mtime +365 -exec rm -f {} \;

This way, on January 1st, it will delete the files from the previous year (not the one that has just ended :)