Databases Reference
In-Depth Information
How to do it...
Carry out the following steps to rotate the .out file:
1. Log in as a wls user to shell and create a new file wls-stdout-logrotate.conf
and save it to the $DOMAIN_HOME folder:
[wls@prod01]$ cd /oracle/Middleware/user_projects/domains/PROD_
DOMAIN
[wls@prod01]$ vi wls-stdout-logrotate.conf
2. Add the following lines to the file:
# WebLogic STDOUT logrotate for PROD_DOMAIN
/oracle/Middleware/user_projects/domains/PROD_DOMAIN/servers/
PROD_*/logs/*.out {
rotate 20
size 50M
copytruncate
nocompress
missingok
nodateext
noolddir
create 0640 wls wls
}
3. Type :ws! to save the file and exit.
4. Change to root user and create the wls-stdout-logrotate file to add new entry
to the hourly crontab:
[root@prod01]# vi /etc/cron.hourly/wls-stdout-logrotate
5. Add the following lines to the script:
#!/bin/sh
sudo /usr/sbin/logrotate /oracle/Middleware/user_projects/domains/
PROD_DOMAIN/wls-stdout-logrotate.conf
RETCODE=$?
if [ $RETCODE != 0 ]; then
/usr/bin/logger -t logrotate "WLS STDOUT logrotate finished
abnormally with code [$RETCODE]"
fi
exit 0
 
Search WWH ::




Custom Search