my O.S. is:
Linux version 2.6.18-308.1.1.el5 (Red Hat 4.1.2-52))
I have a log file "audit.log" that grows fast and when it exceeds the size of 5 gigabyte it blocks my application.
Now I'd like to create a script that does the compression of this file (i.e. audit.log.YYYYMMDD-HHMISS.gz) and I'd like to run it automatically every night (i.e. at 02:00 AM) and removes the old files every 2 months.
Can anyone tell me, in detail, how I can write this script?
Thanks in advance!