Can someone please help me write script for below requirement:
Create a process/script that monitors that access file. When it gets close to 2GB automatically rotate the file. After the logs are rotated, zip them up into the following format: access.date-time.etcap35.gz errors.date-time.etcap35.gz
the date-time portion should be formatted like this: 09Nov-0545AM (DDMon-HHMM) After they have been zipped up, move them to another server named etcap37 into: /opt/webtrends/logs/RawLogs/etcap35-36 dir (due to the ftp restrictions, you may have to ftp into your local account then have the 'wtrs' account move them to: /opt/webtrends/logs/RawLogs/etcap35-36)
Ease Up. Every question here is "urgent", at least to the person asking it. As for your problem, I believe it is difficult to truncate a file that is in use by a process. I think your best bet is to dig into the iPlanet documentation and see what your log options are. I have experience with Weblogic and it allows log rotation by size or date. You can then write a separate cron task to move the files.