Alert log file rotation in Linux Platform
Step 1: Create a job in Crontab as follows:
Make a new line of job and choose the time when you want to run the crontab job:
00 9 * * 1 /usr/sbin/logrotate -s /u01/app/oracle/config/alertrotate.status /u01/app/oracle/config/alertrotate.conf
Step 2: Open the file alertrotate.status see the code writen or copy paste the following file for creating alert rotate status file.
Alertrotate.status has path of the alert log file.
oracle@: /u01/app/oracle/script # more /u01/app/oracle/config/alertrotate.status
logrotate state -- version 2
"/u01/app/oracle/diag/rdbms//trace/alert_.log" 2013-7-22
Step 3: Alert rotate config file mention the parameter on what bases it rotate , weekly monthly etc, compress etc
oracle@: /u01/app/oracle/script # more /u01/app/oracle/config/alertrotate.conf
/u01/app/oracle/diag/rdbms//trace/alert_.log {
weekly
missingok
rotate 7
compress
create
}