File compression and log rotation

36 views Asked by At

I have a usecase to compress 5 days of log files and then delete 7 days data. My folder structure is as /user/var/logs/fw/2024-01.01/01.log.

At the moment I have a cron which is rotating the logs after 7 days. But my requirement is to keep compressed data for 5 days and 2 days of uncompressed data. I want to compress and store the the compressed files in a different folder like / /user/var/backup-logs/fw/2024-01-01.tar.gz. Can some suggest something regarding this. Thanks

0

There are 0 answers