1

Compressing previous log automatically

view story
linux-howto

http://www.unix.com – I want to create a script that will zip the previous log. Example. abc.log.2012.12.02 abc.log.2012.12.01.gzip abc.log If today is 2012.12.03 , my current log is abc.log and my previous date is 2012.12.02, i want abc.log.2012.12.02 to compress everytime I run the script. I can manually run compress the file gzip abc.log.2012.12.02 but I want the log to automate every 2am in the morning. Every 1200midnight the file is rotating and it creates a previous date, and I want this previous date file to be compress. I now how to use the cronjob but i dont have script to do it. Pleas (HowTos)