Last active
August 29, 2015 14:07
-
-
Save tkuchiki/873bd77eb27b0d2fc750 to your computer and use it in GitHub Desktop.
sar で Invalid system activity file(システム動作情報ファイルの形式が正しくありません) と表示されたときに、ファイルを掃除する
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/bash | |
SAR_DIR=/var/log/sa | |
for FILE in $(ls ${SAR_DIR}); do | |
SAR_FILE="${SAR_DIR}/${FILE}" | |
sar -f $SAR_FILE >& /dev/null || rm -f $SAR_FILE && test -f $SAR_FILE || echo "removed ${SAR_FILE}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment