{"id":537,"date":"2020-01-29T16:10:14","date_gmt":"2020-01-29T08:10:14","guid":{"rendered":"https:\/\/play.datalude.com\/blog\/?p=537"},"modified":"2023-02-23T10:31:56","modified_gmt":"2023-02-23T02:31:56","slug":"systemctl-journals-filling-up-your-disk","status":"publish","type":"post","link":"https:\/\/play.datalude.com\/blog\/2020\/01\/systemctl-journals-filling-up-your-disk\/","title":{"rendered":"systemctl journals filling up your disk"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Quick one &#8230; your system probably uses logrotate to keep a fixed number of logs, and which stops your disk filling up. Trouble is, that systemctl doesn't write logs in the normal way so you can't rely on logrotate any more. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check out your current systemctl log usage with <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">journalctl --disk-usage<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Wait, whaaaat? Its using up 4Gb? By default journalctl will take up 15% of  your disk, which seems a little greedy. You can immediately prune some of the logs with the following, which will limit to the size specified 200M, 1G, 500k etc. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">journalctl --vacuum-size=500M<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That buys you some space immediately on a system which is running out of room. If you want a longer term solution you can edit \/etc\/systemd\/journald.conf and try setting eg.<br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SystemMaxUse=500M\nSystemKeepFree=1G<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Quick one &#8230; your system probably uses logrotate to keep a fixed number of logs, and which stops your disk filling up. Trouble is, that systemctl doesn't write logs in the normal way so you can't rely on logrotate any more. Check out your current systemctl log usage with journalctl &#8211;disk-usage Wait, whaaaat? Its using &#8230; <a title=\"systemctl journals filling up your disk\" class=\"read-more\" href=\"https:\/\/play.datalude.com\/blog\/2020\/01\/systemctl-journals-filling-up-your-disk\/\" aria-label=\"Read more about systemctl journals filling up your disk\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1,4,5],"tags":[],"class_list":["post-537","post","type-post","status-publish","format-standard","hentry","category-it","category-linux","category-security"],"_links":{"self":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/posts\/537","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/comments?post=537"}],"version-history":[{"count":0,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/posts\/537\/revisions"}],"wp:attachment":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/media?parent=537"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/categories?post=537"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/tags?post=537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}