Need Script to ZIP/SAVE & then DELETE Log file & send a mail conformation for any error

ENVIROMENT
Linux: RHEL 6.4
Log Path: /usr/iplanet/servers/https-company/logs
Log Format: user.log.03-15-2015
I have log4j log rotation enabled rotating files on a daily basis.

The rotated logs are NOT compressed & are taking up too much space.

I need a script that will run daily that will do 3 things:

  1. Check the folder for uncompressed log files, compress them into a ZIP file
  2. Delete the uncompressed log files after they are compressed
  3. Check the folder & delete the ZIP log files that are OLDER than 6 months.
  4.  send mail for any error and successful

So please provide us with the script you have tried to write yourself.

Thanks.

We are here to help you write your own scripts; not write scripts for you.