LoginSignup
13
3

"cleanlog" symbol nodeの掃除

Posted at

symbol nodeを長い間稼働していると
過去の log fileが溜まってきて disk容量をそれなりに圧迫します
この log fileを削除する shell scriptです

mainnetと testnetのどちらでも使えます

使い方

nodeを停止する必要はありません
nodeの作業ディレクトリ(targetの直上)で

wget 10.dusanjp.com/cleanlog

file "cleanlog"が downloadされます

sh cleanlog

image.png
実行前と実行後の targetの 容量を表示します これで完了です
長期間稼働させていた node程効果があります

cleanlog の内容

du -sh target
ls -t1 target/nodes/node/logs/catapult_broker*.log | tail -n+2 | xargs rm -rf
ls -t1 target/nodes/node/logs/catapult_server*.log | tail -n+2 | xargs rm -rf
ls -t1 target/nodes/node/logs/catapult_recovery*.log | tail -n+2 | xargs rm -rf
cd target/nodes/node/data/statedb
rm -rf AccountRestrictionCache/LOG.old*
rm -rf MetadataCache/LOG.old*
rm -rf NamespaceCache/LOG.old*
rm -rf AccountStateCache/LOG.old*
rm -rf MosaicCache/LOG.old*
rm -rf SecretLockInfoCache/LOG.old*
rm -rf HashCache/LOG.old*
rm -rf MosaicRestrictionCache/LOG.old*
rm -rf HashLockInfoCache/LOG.old*
rm -rf MultisigCache/LOG.old*
cd -
du -sh target
13
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
3