Created
October 7, 2011 08:44
-
-
Save bobbyjam99-zz/1269803 to your computer and use it in GitHub Desktop.
WebLogicをノードマネージャ経由で起動する場合コンソールログは起動時にしかローテートされない。強制的にローテートさせるスクリプト。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#コンソールログファイル | |
CONSOLELOG_PATH=/opt/app/weblogic/user_projects/domains/base_domain/servers/base_server_01/logs/base_server_01.out | |
#バックアップ世代数 | |
GENERATION=7 | |
idx=$GENERATION | |
until [ $idx -eq 0 ]; | |
do | |
if [ -f $CONSOLELOG_PATH.$idx ]; then | |
if [ $idx -eq $GENERATION ]; then | |
/bin/rm -f $CONSOLELOG_PATH.$idx | |
else | |
bkno=`expr $idx + 1` | |
/bin/mv -f $CONSOLELOG_PATH.$idx $CONSOLELOG_PATH.$bkno | |
fi | |
fi | |
idx=`expr $idx - 1` | |
done | |
cp $CONSOLELOG_PATH $CONSOLELOG_PATH.1 | |
cp $CONSOLELOG_PATH.brank $CONSOLELOG_PATH | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment