Total Pageviews

Sunday, December 24, 2017

Compress older log file, log files older than 2 days linux command


Compress files older than 2 days cronjob command

find /var/forgerock/server/logs/ -mtime +1 -exec gzip {} \;

to cronjob use below

05 01 * * * find /var/forgerock/server/logs/ -mtime +1 -exec gzip {} \;


To delete or print

Find -mtime +120 -print
Find -mtime +120 -delete


No comments:

Post a Comment