Help us understand the problem. What is going on with this article?

jenkinsのディスク容量がいっぱいになったら

More than 3 years have passed since last update.

起こったこと

jenkinsをバッチサーバーとして運用し、バッチのログファイルなどでディスク容量が足りなくなった(newrelicでディスク容量を監視してる)

対応

jenkinsサーバーにログインして、状況確認

# 全体容量確認
$ df -h 

# 容量食ってるフォルダ確認
$ sudo du -sh /var/lib/jenkins/workspace/* | sort -h -r | head -10
$ sudo du -sh /var/lib/jenkins/jobs/* | sort -h -r | head -10

自分の場合は一部のバッチがbuild回数が多くて、ログファイルで14G以上使ってた

手動で消すのは面倒で、関連するプラグインがないかを調査

  • ディスク容量の把握

    • Disk Usage Plugin
    • 利用量が大きいタスクから以下のビルド履歴削除を設定する
  • ビルド履歴の削除

    • Discard Old Build plugin
    • プロジェクト毎の設定画面に「古いビルドの破棄」オプションが追加されたので、それを30日以上、100ビルドなどに適切設定する
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away