{"id":2934,"date":"2022-02-02T22:01:54","date_gmt":"2022-02-02T21:01:54","guid":{"rendered":"https:\/\/davidlebech.com\/thoughtflow\/?p=2934"},"modified":"2022-03-16T07:11:51","modified_gmt":"2022-03-16T06:11:51","slug":"clean-up-harddrive-space-on-ubuntu-server-with-journalctl","status":"publish","type":"post","link":"https:\/\/davidlebech.com\/thoughtflow\/clean-up-harddrive-space-on-ubuntu-server-with-journalctl\/","title":{"rendered":"Clean up harddrive space on Ubuntu Server with journalctl"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">After running for a while, an Ubuntu server tend to get bloated with&#8230; stuff. One particularly weird one is the disk usage of a bunch of \/var\/log\/journal\/* entries that hog a lot of space.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In my case, 2GB. This is significant on a machine with just 20GB of space. You can see their disk usage with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl --disk-usage<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">I honestly don&#8217;t know what the journals are for, but anyway, there is a quick solution to clean it up in an easy way:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl --vacuum-size=100M<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This command will &#8220;vacuum&#8221; the journal logs and free up space. More info in <a href=\"https:\/\/unix.stackexchange.com\/questions\/139513\/how-to-clear-journalctl\">this Stack Exchange answer<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After running for a while, an Ubuntu server tend to get bloated with&#8230; stuff. One particularly weird one is the disk usage of a bunch of \/var\/log\/journal\/* entries that hog a lot of space. In my case, 2GB. This is significant on a machine with just 20GB of space. You can see their disk usage [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[32,72],"class_list":["post-2934","post","type-post","status-publish","format-standard","hentry","category-tips","tag-tip","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/davidlebech.com\/thoughtflow\/wp-json\/wp\/v2\/posts\/2934","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/davidlebech.com\/thoughtflow\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/davidlebech.com\/thoughtflow\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/davidlebech.com\/thoughtflow\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/davidlebech.com\/thoughtflow\/wp-json\/wp\/v2\/comments?post=2934"}],"version-history":[{"count":0,"href":"https:\/\/davidlebech.com\/thoughtflow\/wp-json\/wp\/v2\/posts\/2934\/revisions"}],"wp:attachment":[{"href":"https:\/\/davidlebech.com\/thoughtflow\/wp-json\/wp\/v2\/media?parent=2934"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/davidlebech.com\/thoughtflow\/wp-json\/wp\/v2\/categories?post=2934"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/davidlebech.com\/thoughtflow\/wp-json\/wp\/v2\/tags?post=2934"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}