{"id":28315,"date":"2018-09-27T04:18:22","date_gmt":"2018-09-27T09:18:22","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=28315"},"modified":"2023-04-05T02:04:12","modified_gmt":"2023-04-05T07:04:12","slug":"how-to-deal-with-huge-log-files-in-linux","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/","title":{"rendered":"How to Deal with Huge (and Growing) Log Files in Linux"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><p><img decoding=\"async\" class=\"size-full wp-image-28321 alignnone\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/How-to-Deal-with-Huge-Log-Files-in-Linux.jpg\" alt=\"How to Deal with Huge Log Files in Linux\" width=\"742\" height=\"372\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/How-to-Deal-with-Huge-Log-Files-in-Linux.jpg 742w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/How-to-Deal-with-Huge-Log-Files-in-Linux-150x75.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/How-to-Deal-with-Huge-Log-Files-in-Linux-300x150.jpg 300w\" sizes=\"(max-width: 742px) 100vw, 742px\" \/><\/p>\n<p>If you&#8217;ve managed a Linux server for any length of time, you&#8217;re familiar with the problem of log files. They can sometimes be difficult enough to even <i>find<\/i> in the first place, and then you&#8217;re sometimes confronted with a file that&#8217;s hundreds of MB in size (or even GB). Searching through it is a pain, and they can eventually even start eating up your storage space.<!--more--><\/p>\n<p>This tutorial will show you how to deal with this problem. We&#8217;re going to make use of the inbuilt Linux package for system logs that&#8217;s already in place. This means you don&#8217;t need to install any new packages! All you need to know is how to add the configuration for your own log files.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69ec08f9a5dea\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69ec08f9a5dea\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/#Seeing-How-Linux-Logs-are-Rotated-with-logrotate\" >Seeing How Linux Logs are Rotated with logrotate<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/#Checking-Logrotates-Default-Configuration\" >Checking Logrotate&#8217;s Default Configuration<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/#Adding-Files-to-logrotate\" >Adding Files to logrotate<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/#Creating-your-Own-Logrotate-File-for-your-Logs\" >Creating your Own Logrotate File for your Logs<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"western\"><span class=\"ez-toc-section\" id=\"Seeing-How-Linux-Logs-are-Rotated-with-logrotate\"><\/span>Seeing How Linux Logs are Rotated with logrotate<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>There are a bunch of system log files in the following location:<\/p>\n<pre>\/var\/log\/<\/pre>\n<p>In the screenshot below, I list all the files in that directory and show the file size in MB:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-28316\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Log-files-with-Date-Stamp.jpg\" alt=\"Log files with date stamp\" width=\"500\" height=\"309\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Log-files-with-Date-Stamp.jpg 500w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Log-files-with-Date-Stamp-150x93.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Log-files-with-Date-Stamp-300x185.jpg 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<p>As you can see, there are lots of large log files that are datestamped. These are generated by the &#8220;logrotate&#8221; by default. Looking at the timestamps, we can see that they&#8217;re generated once every seven days. So for each log file here, logrotate does the following:<\/p>\n<ol>\n<li>Renames the log file with a timestamp<\/li>\n<li>Creates a new empty log file with the same name as before<\/li>\n<\/ol>\n<h2 class=\"western\"><span class=\"ez-toc-section\" id=\"Checking-Logrotates-Default-Configuration\"><\/span>Checking Logrotate&#8217;s Default Configuration<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Logrotate checks the following file for its configuration:<\/p>\n<pre>\/etc\/logrotate.conf<\/pre>\n<p>In this, we can see that it gets all the important information about:<\/p>\n<ol>\n<li>How often it should rotate the logs<\/li>\n<li>How many backups should it keep<\/li>\n<li>What kind of suffix it should add to the old logs<\/li>\n<li>Whether or not it should compress them<\/li>\n<li>etc&#8230;<\/li>\n<\/ol>\n<p>Here&#8217;s a screenshot of the logrotate configuration file:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-28317\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Logrotate-Default-Configuration-Allow-Compression.jpg\" alt=\"Logrotate Default Configuration, Allow Compression\" width=\"500\" height=\"333\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Logrotate-Default-Configuration-Allow-Compression.jpg 500w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Logrotate-Default-Configuration-Allow-Compression-150x100.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Logrotate-Default-Configuration-Allow-Compression-300x200.jpg 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<p>By default, the old log files are not compressed. You can change this by simply uncommenting the &#8220;compress&#8221; directive as shown above.<\/p>\n<h2 class=\"western\"><span class=\"ez-toc-section\" id=\"Adding-Files-to-logrotate\"><\/span>Adding Files to logrotate<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>How does logrotate know which logs to work on? The files in this directory:<\/p>\n<pre>\/etc\/logrotate.d<\/pre>\n<p>For example, in our &#8220;secure&#8221; log that we saw in the first screenshot, we can figure out which file in logrotate.d contains it by using a simple grep command, as detailed in our guide on <a href=\"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/\">grep for advanced users<\/a>:<\/p>\n<pre><span lang=\"fr-FR\">grep -r secure \/etc\/logrotate.d<\/span><\/pre>\n<p>The screenshot below reveals which file is responsible for the &#8220;secure&#8221; log:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-28318\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Configuration-File-in-logrotate-Directory.jpg\" alt=\"Configuration File in logrotate Directory\" width=\"500\" height=\"202\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Configuration-File-in-logrotate-Directory.jpg 500w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Configuration-File-in-logrotate-Directory-150x61.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Configuration-File-in-logrotate-Directory-300x121.jpg 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<p>Opening &#8220;syslog&#8221;, we can see that it tells logrotate to work on a number of files:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-28319\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/List-of-Log-Files-to-Rotate.jpg\" alt=\"List of Log Files to Rotate\" width=\"500\" height=\"308\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/List-of-Log-Files-to-Rotate.jpg 500w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/List-of-Log-Files-to-Rotate-150x92.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/List-of-Log-Files-to-Rotate-300x185.jpg 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<p>All of these are located in \/var\/log\/. So each file contains:<\/p>\n<ol>\n<li>The names of the log files that it should rotate<\/li>\n<li>Directives specific to that particular file<\/li>\n<li>In the absence of directives, the defaults from logrotate.conf will be used<\/li>\n<\/ol>\n<h2 class=\"western\"><span class=\"ez-toc-section\" id=\"Creating-your-Own-Logrotate-File-for-your-Logs\"><\/span>Creating your Own Logrotate File for your Logs<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>We can follow the template above to create an entry with logrotate that tells us it to process our own files in the same way.<\/p>\n<h3 class=\"western\">Get the Owner and Group for your Directory<\/h3>\n<p>To make sure that all permissions are in place, we need logrotate to run with the appropriate permissions. Navigate to the directory that contains the log file(s) you want to process and get the owner as well as the group using this command:<\/p>\n<pre>ls -l -d<\/pre>\n<p>For example, the \/var\/log directory has the owner as&#8221; root&#8221;, and the group as &#8220;root&#8221; as well:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-28320\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Get-Directory-Owner-and-Group.jpg\" alt=\"Get Directory Owner and Group.\" width=\"500\" height=\"154\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Get-Directory-Owner-and-Group.jpg 500w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Get-Directory-Owner-and-Group-150x46.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Get-Directory-Owner-and-Group-300x92.jpg 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<h3 class=\"western\">Create a Logrotate File with the Configuration<\/h3>\n<p>Next, create a new file in \/etc\/logrotate.d\/ and paste the following sample configuration into it:<\/p>\n<pre><b>\/var\/log\/newlogfile<\/b> {\r\n\r\nsize 10M\r\n\r\ncompress\r\n\r\ndelaycompress\r\n\r\n<b>su root root<\/b>\r\n\r\n}<\/pre>\n<p>Replace <b>\/var\/log\/newlogfile<\/b> with the location of your own log file. Also, replace <b>su root root<\/b> with the owner and group name you got in the previous step. Here&#8217;s a <a href=\"https:\/\/www.rosehosting.com\/blog\/how-to-use-logrotate-to-manage-logs-on-ubuntu\/\">list of logrotate directives<\/a> you can use. The &#8220;delaycompress&#8221; directive tells logrotate to only compress files that are 2 versions old, or older. This way you have quick and easy access to the most recently compressed log file.<\/p>\n<p>You can also use the following lines within the curly brackets block to run scripts after and before your log files are rotated:<\/p>\n<pre>postrotate\r\n\/\/ scripts for post rotation go here\r\nendscript<\/pre>\n<p>As you can see, Linux has a complete solution for log file rotation. All you need to do is add a few lines of code to the existing framework, and your own log files can be rotated without any hassles!<\/p>\n<hr \/>\n<p>If you are one of our <a href=\"https:\/\/www.rosehosting.com\">managed VPS hosting<\/a> clients, you can simply ask our system administrators to deal with huge files on your Linux server. They are available 24\/7 and will take care of your request immediately.<\/p>\n<p>If you find this blog post useful, please share it with your friends via social media networks, or if you have any question please leave a comment below and we will reply to it. Thanks!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;ve managed a Linux server for any length of time, you&#8217;re familiar with the problem of log files. They &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Deal with Huge (and Growing) Log Files in Linux\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/#more-28315\" aria-label=\"Read more about How to Deal with Huge (and Growing) Log Files in Linux\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":28321,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1236,2071,13],"tags":[1752,27],"class_list":["post-28315","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guides","category-linux","category-tutorials","tag-big-files","tag-linux","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Deal with Huge (and Growing) Log Files in Linux | RoseHosting<\/title>\n<meta name=\"description\" content=\"How to Deal with Huge (and Growing) Log Files in Linux | RoseHosting\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Deal with Huge (and Growing) Log Files in Linux\" \/>\n<meta property=\"og:description\" content=\"How to Deal with Huge (and Growing) Log Files in Linux | RoseHosting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"RoseHosting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RoseHosting\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/rosehosting.helpdesk\" \/>\n<meta property=\"article:published_time\" content=\"2018-09-27T09:18:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-05T07:04:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/How-to-Deal-with-Huge-Log-Files-in-Linux.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"742\" \/>\n\t<meta property=\"og:image:height\" content=\"372\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jeff Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:site\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-deal-with-huge-log-files-in-linux\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-deal-with-huge-log-files-in-linux\\\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"How to Deal with Huge (and Growing) Log Files in Linux\",\"datePublished\":\"2018-09-27T09:18:22+00:00\",\"dateModified\":\"2023-04-05T07:04:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-deal-with-huge-log-files-in-linux\\\/\"},\"wordCount\":790,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-deal-with-huge-log-files-in-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/09\\\/How-to-Deal-with-Huge-Log-Files-in-Linux.jpg\",\"keywords\":[\"big files\",\"Linux\"],\"articleSection\":[\"Guides\",\"Linux\",\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-deal-with-huge-log-files-in-linux\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-deal-with-huge-log-files-in-linux\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-deal-with-huge-log-files-in-linux\\\/\",\"name\":\"How to Deal with Huge (and Growing) Log Files in Linux | RoseHosting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-deal-with-huge-log-files-in-linux\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-deal-with-huge-log-files-in-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/09\\\/How-to-Deal-with-Huge-Log-Files-in-Linux.jpg\",\"datePublished\":\"2018-09-27T09:18:22+00:00\",\"dateModified\":\"2023-04-05T07:04:12+00:00\",\"description\":\"How to Deal with Huge (and Growing) Log Files in Linux | RoseHosting\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-deal-with-huge-log-files-in-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-deal-with-huge-log-files-in-linux\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-deal-with-huge-log-files-in-linux\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/09\\\/How-to-Deal-with-Huge-Log-Files-in-Linux.jpg\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/09\\\/How-to-Deal-with-Huge-Log-Files-in-Linux.jpg\",\"width\":742,\"height\":372,\"caption\":\"How to Deal with Huge Log Files in Linux\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-deal-with-huge-log-files-in-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Deal with Huge (and Growing) Log Files in Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"name\":\"RoseHosting.com\",\"description\":\"Premium Linux Tutorials Since 2001\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\",\"name\":\"RoseHosting\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"RoseHosting\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/RoseHosting\",\"https:\\\/\\\/x.com\\\/rosehosting\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/rosehosting\\\/\"],\"description\":\"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.\",\"email\":\"info@rosehosting.com\",\"telephone\":\"(314) 275-0414\",\"legalName\":\"Rose Web Services LLC\",\"foundingDate\":\"2001-04-02\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\",\"name\":\"Jeff Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"caption\":\"Jeff Wilson\"},\"description\":\"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.\",\"sameAs\":[\"https:\\\/\\\/www.rosehosting.com\",\"https:\\\/\\\/www.facebook.com\\\/rosehosting.helpdesk\"],\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/author\\\/jwilson\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Deal with Huge (and Growing) Log Files in Linux | RoseHosting","description":"How to Deal with Huge (and Growing) Log Files in Linux | RoseHosting","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"How to Deal with Huge (and Growing) Log Files in Linux","og_description":"How to Deal with Huge (and Growing) Log Files in Linux | RoseHosting","og_url":"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2018-09-27T09:18:22+00:00","article_modified_time":"2023-04-05T07:04:12+00:00","og_image":[{"width":742,"height":372,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/How-to-Deal-with-Huge-Log-Files-in-Linux.jpg","type":"image\/jpeg"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"How to Deal with Huge (and Growing) Log Files in Linux","datePublished":"2018-09-27T09:18:22+00:00","dateModified":"2023-04-05T07:04:12+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/"},"wordCount":790,"commentCount":1,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/How-to-Deal-with-Huge-Log-Files-in-Linux.jpg","keywords":["big files","Linux"],"articleSection":["Guides","Linux","Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/","url":"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/","name":"How to Deal with Huge (and Growing) Log Files in Linux | RoseHosting","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/How-to-Deal-with-Huge-Log-Files-in-Linux.jpg","datePublished":"2018-09-27T09:18:22+00:00","dateModified":"2023-04-05T07:04:12+00:00","description":"How to Deal with Huge (and Growing) Log Files in Linux | RoseHosting","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/How-to-Deal-with-Huge-Log-Files-in-Linux.jpg","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/How-to-Deal-with-Huge-Log-Files-in-Linux.jpg","width":742,"height":372,"caption":"How to Deal with Huge Log Files in Linux"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-deal-with-huge-log-files-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Deal with Huge (and Growing) Log Files in Linux"}]},{"@type":"WebSite","@id":"https:\/\/www.rosehosting.com\/blog\/#website","url":"https:\/\/www.rosehosting.com\/blog\/","name":"RoseHosting.com","description":"Premium Linux Tutorials Since 2001","publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rosehosting.com\/blog\/#organization","name":"RoseHosting","url":"https:\/\/www.rosehosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"RoseHosting"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RoseHosting","https:\/\/x.com\/rosehosting","https:\/\/www.linkedin.com\/in\/rosehosting\/"],"description":"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.","email":"info@rosehosting.com","telephone":"(314) 275-0414","legalName":"Rose Web Services LLC","foundingDate":"2001-04-02","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713","name":"Jeff Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","caption":"Jeff Wilson"},"description":"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.","sameAs":["https:\/\/www.rosehosting.com","https:\/\/www.facebook.com\/rosehosting.helpdesk"],"url":"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/28315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/comments?post=28315"}],"version-history":[{"count":5,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/28315\/revisions"}],"predecessor-version":[{"id":45301,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/28315\/revisions\/45301"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/28321"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=28315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=28315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=28315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}