Last active
December 17, 2015 21:39
-
-
Save nikushi/5676121 to your computer and use it in GitHub Desktop.
netstatとpsをcrontabで毎分ロギング + 超手抜きlogrotate
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
# 過去1週間分のコマンド出力を保存 | |
0 0 * * * cat /dev/null > /var/log/netstat.out.`date +\%w` | |
* * * * * ( LANG=C date; netstat -antop; echo ) >> /var/log/netstat.out.`date +\%w` | |
0 0 * * * cat /dev/null > /var/log/ps.out.`date +\%w` | |
* * * * * ( LANG=C date; ps axufw; echo ) >> /var/log/ps.out.`date +\%w` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment