Created
March 3, 2012 14:33
-
-
Save kshimo69/1966455 to your computer and use it in GitHub Desktop.
syslogの出力をsyslogdのrestart毎にファイル分割する ref: http://qiita.com/items/2979
This file contains 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
FILE="tmp"; for i in messages.4 messages.3 messages.2 messages.1 messages; do while read LINE; do if echo $LINE|grep -q restart; then FILE="`echo $LINE|awk '{ print $1$2$3 }'`.log"; fi; echo $LINE >> $FILE; done < $i; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment