{"id":21105,"date":"2017-01-20T07:46:02","date_gmt":"2017-01-20T13:46:02","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=21105"},"modified":"2022-06-03T03:42:22","modified_gmt":"2022-06-03T08:42:22","slug":"how-to-use-logrotate-to-manage-logs-on-ubuntu","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-use-logrotate-to-manage-logs-on-ubuntu\/","title":{"rendered":"How to Use Logrotate to Manage Logs on Ubuntu"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><p><img decoding=\"async\" class=\"alignnone size-full wp-image-24951\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2017\/01\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu.jpg\" alt=\"How to Use Logrotate to Manage Logs on Ubuntu\" width=\"1200\" height=\"600\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2017\/01\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu.jpg 1200w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2017\/01\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu-150x75.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2017\/01\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu-300x150.jpg 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2017\/01\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu-768x384.jpg 768w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2017\/01\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu-1024x512.jpg 1024w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2017\/01\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu-860x430.jpg 860w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2017\/01\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu-680x340.jpg 680w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2017\/01\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu-500x250.jpg 500w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2017\/01\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu-400x200.jpg 400w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2017\/01\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu-200x100.jpg 200w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2017\/01\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu-50x25.jpg 50w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<p>We&#8217;ll show you, How to Use Logrotate to Manage Logs on Ubuntu. Logrotate is a tool used by the system administrators to ease the management of large log files generated by the system services. The most important features of logrotate are automatic log rotation, log compression, log removal and mailing the log files. In this tutorial, we are going to show you how to use logrotate to manage the <a href=\"https:\/\/www.rosehosting.com\/blog\/linux-log-files\/\">log files generated by the services running on your Linux VPS<\/a>.<br \/>\n<!--more--><\/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-69f0b52b4630e\" 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-69f0b52b4630e\"  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-use-logrotate-to-manage-logs-on-ubuntu\/#1-Connect-via-SSH-and-check-if-Logrotate-is-installed\" >1. Connect via SSH and check if Logrotate is installed<\/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-use-logrotate-to-manage-logs-on-ubuntu\/#2-Resynchronize-the-package-index-and-upgrade-all-packages\" >2. Resynchronize the package index and upgrade all packages<\/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-use-logrotate-to-manage-logs-on-ubuntu\/#4-Verify-the-installation\" >4. Verify the installation<\/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-use-logrotate-to-manage-logs-on-ubuntu\/#5-Configuration-Options\" >5. Configuration Options<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"1-Connect-via-SSH-and-check-if-Logrotate-is-installed\"><\/span>1. Connect via SSH and check if Logrotate is installed<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Before we start, make sure that logrotate is installed on your server. <a href=\"https:\/\/www.rosehosting.com\/blog\/connect-to-your-linux-vps-via-ssh\/\">Connect to your server via SSH<\/a> and check if logrotate is installed by using the following command:<\/p>\n<pre>sudo dpkg -l | grep logrotate<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"2-Resynchronize-the-package-index-and-upgrade-all-packages\"><\/span>2. Resynchronize the package index and upgrade all packages<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If it is not installed on your <a href=\"https:\/\/www.rosehosting.com\/ubuntu-hosting.html\">Ubuntu VPS<\/a>, we will help you to install it. First, resynchronize the package index and upgrade all packages currently installed on the system to the newest version using the commands below:<\/p>\n<pre>sudo apt-get update\r\nsudo apt-get upgrade<\/pre>\n<p>3. Install Logrotate<\/p>\n<p>Once the package manager completes the upgrade, go ahead and install logrotate:<\/p>\n<pre>sudo apt-get install logrotate<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"4-Verify-the-installation\"><\/span>4. Verify the installation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Verify that the installation was successful:<\/p>\n<pre>sudo logrotate<\/pre>\n<p>You should get a message like the following:<\/p>\n<pre>logrotate 3.8.7 - Copyright (C) 1995-2001 Red Hat, Inc.\r\nThis may be freely redistributed under the terms of the GNU Public License\r\n\r\nUsage: logrotate [-dfv?] [-d|--debug] [-f|--force] [-m|--mail=command] [-s|--state=statefile] [-v|--verbose] [--version] [-?|--help] [--usage] [OPTION...] \r\n<\/pre>\n<p>The main configuration file for logrotate is <code>\/etc\/logrotate.conf<\/code> while application specific configuration files are stored in the <code>\/etc\/logrotate.d<\/code> directory.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"5-Configuration-Options\"><\/span>5. Configuration Options<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Depending on what services are installed on your Ubuntu VPS, the <code>\/etc\/logrotate.d<\/code> directory may contain more or less configuration files. If you haven&#8217;t checked already, now is time to list the content of that directory and get familiar with the services for which logrotate is configured to work. As an example, we will use the <code>\/etc\/logrotate.d\/dpkg<\/code> file to show you some of the most important configuration options. Open the file using a text editor:<\/p>\n<pre>sudo nano \/etc\/logrotate.d\/dpkg<\/pre>\n<p>The content of the configuration file should be similar to the one below:<\/p>\n<pre>\/var\/log\/dpkg.log {\r\n        monthly\r\n        rotate 12\r\n        compress\r\n        delaycompress\r\n        missingok\r\n        notifempty\r\n        create 644 root root\r\n}\r\n\/var\/log\/alternatives.log {\r\n        monthly\r\n        rotate 12\r\n        compress\r\n        delaycompress\r\n        missingok\r\n        notifempty\r\n        create 644 root root\r\n}\r\n<\/pre>\n<p>Logrotate checks <code>\/var\/log\/dpkg.log<\/code> and <code>\/var\/log\/alternatives.log<\/code> on a monthly basis. The rotation time is specified with the <code>monthly<\/code> option. Other rotation options are <code>daily<\/code>, <code>hourly<\/code>, <code>weekly<\/code> and <code>yearly<\/code>.<\/p>\n<p><code>rotate<\/code> tells how many times the log files should be rotated before being removed or mailed to a specific address. In this example, the log files will be rotated 12 times. In a case when <code>rotate<\/code> is set to 0, old log files are removed rather than rotated.<\/p>\n<p>The next option is <code>compress<\/code> which specifies that the old version of the log files should be compressed. Alternative option is <code>nocompress<\/code> and in can be used in cases when the old versions of the log files should not be compressed.<\/p>\n<p><code>delaycompress<\/code> specifies that the compression of the previous log file should be postponed to the next rotation cycle.<\/p>\n<p><code>missingok<\/code> and <code>notifempty<\/code> are used to skip the rotation without issuing an error message if the log file is missing and to skip the rotation if the log file is empty.<\/p>\n<p><code>create 644 root root<\/code> is used to create a log file immediately after the rotation using specific mode, owner and group.<\/p>\n<p>Another option which is not mentioned in this example and you may find useful in your custom configurations is <code>size<\/code>. This option allows you to configure logrotate to rotate the log files only if they get bigger than a specific size. The size can be specified in bytes, kilobytes, megabytes and gigabytes. Therefore, <code>size 100<\/code>, <code>size 100k<\/code>, <code>size 100M<\/code> and <code>size 100G<\/code> are all valid.<\/p>\n<p>For more datails and configuration options you can check the logrotate man page.<\/p>\n<pre>man logrotate<\/pre>\n<p>By default, logrotate is run as a daily cron job. For details about the cron job you can check <code>\/etc\/cron.daily\/logrotate<\/code>. You can freely set up the cron job for logrotate to run hourly, weekly, yearly or at a specific time and\/or day.<\/p>\n<p>Of course, you don\u2019t have to Use Logrotate to Manage Logs on Ubuntu, if you use one of our <a href=\"https:\/\/www.rosehosting.com\/ubuntu-hosting.html\">Managed Ubuntu Hosting Services,<\/a> in which case you can simply ask our expert Linux admins to configure logrotate for you. They are available 24\u00d77 and will take care of your request immediately.<\/p>\n<p>PS. If you liked this post. on\u00a0Use Logrotate to Manage Logs on Ubuntu,\u00a0 please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;ll show you, How to Use Logrotate to Manage Logs on Ubuntu. Logrotate is a tool used by the system &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Use Logrotate to Manage Logs on Ubuntu\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-use-logrotate-to-manage-logs-on-ubuntu\/#more-21105\" aria-label=\"Read more about How to Use Logrotate to Manage Logs on Ubuntu\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":24951,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,1698],"tags":[1473,1439,59],"class_list":["post-21105","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-ubuntu","tag-logrotate","tag-logs","tag-ubuntu","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 Use Logrotate to Manage Logs on Ubuntu | RoseHosting<\/title>\n<meta name=\"description\" content=\"How to Use Logrotate to Manage Logs on Ubuntu | 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-use-logrotate-to-manage-logs-on-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use Logrotate to Manage Logs on Ubuntu\" \/>\n<meta property=\"og:description\" content=\"How to Use Logrotate to Manage Logs on Ubuntu | RoseHosting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/how-to-use-logrotate-to-manage-logs-on-ubuntu\/\" \/>\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=\"2017-01-20T13:46:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-03T08:42:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2017\/01\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\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-use-logrotate-to-manage-logs-on-ubuntu\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-use-logrotate-to-manage-logs-on-ubuntu\\\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"How to Use Logrotate to Manage Logs on Ubuntu\",\"datePublished\":\"2017-01-20T13:46:02+00:00\",\"dateModified\":\"2022-06-03T08:42:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-use-logrotate-to-manage-logs-on-ubuntu\\\/\"},\"wordCount\":675,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-use-logrotate-to-manage-logs-on-ubuntu\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/01\\\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu.jpg\",\"keywords\":[\"logrotate\",\"logs\",\"ubuntu\"],\"articleSection\":[\"Tutorials\",\"Ubuntu\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-use-logrotate-to-manage-logs-on-ubuntu\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-use-logrotate-to-manage-logs-on-ubuntu\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-use-logrotate-to-manage-logs-on-ubuntu\\\/\",\"name\":\"How to Use Logrotate to Manage Logs on Ubuntu | RoseHosting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-use-logrotate-to-manage-logs-on-ubuntu\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-use-logrotate-to-manage-logs-on-ubuntu\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/01\\\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu.jpg\",\"datePublished\":\"2017-01-20T13:46:02+00:00\",\"dateModified\":\"2022-06-03T08:42:22+00:00\",\"description\":\"How to Use Logrotate to Manage Logs on Ubuntu | RoseHosting\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-use-logrotate-to-manage-logs-on-ubuntu\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-use-logrotate-to-manage-logs-on-ubuntu\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-use-logrotate-to-manage-logs-on-ubuntu\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/01\\\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu.jpg\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/01\\\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu.jpg\",\"width\":1200,\"height\":600,\"caption\":\"How to Use Logrotate to Manage Logs on Ubuntu\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-use-logrotate-to-manage-logs-on-ubuntu\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use Logrotate to Manage Logs on Ubuntu\"}]},{\"@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 Use Logrotate to Manage Logs on Ubuntu | RoseHosting","description":"How to Use Logrotate to Manage Logs on Ubuntu | 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-use-logrotate-to-manage-logs-on-ubuntu\/","og_locale":"en_US","og_type":"article","og_title":"How to Use Logrotate to Manage Logs on Ubuntu","og_description":"How to Use Logrotate to Manage Logs on Ubuntu | RoseHosting","og_url":"https:\/\/www.rosehosting.com\/blog\/how-to-use-logrotate-to-manage-logs-on-ubuntu\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2017-01-20T13:46:02+00:00","article_modified_time":"2022-06-03T08:42:22+00:00","og_image":[{"width":1200,"height":600,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2017\/01\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu.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-use-logrotate-to-manage-logs-on-ubuntu\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-use-logrotate-to-manage-logs-on-ubuntu\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"How to Use Logrotate to Manage Logs on Ubuntu","datePublished":"2017-01-20T13:46:02+00:00","dateModified":"2022-06-03T08:42:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-use-logrotate-to-manage-logs-on-ubuntu\/"},"wordCount":675,"commentCount":0,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-use-logrotate-to-manage-logs-on-ubuntu\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2017\/01\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu.jpg","keywords":["logrotate","logs","ubuntu"],"articleSection":["Tutorials","Ubuntu"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/how-to-use-logrotate-to-manage-logs-on-ubuntu\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-use-logrotate-to-manage-logs-on-ubuntu\/","url":"https:\/\/www.rosehosting.com\/blog\/how-to-use-logrotate-to-manage-logs-on-ubuntu\/","name":"How to Use Logrotate to Manage Logs on Ubuntu | RoseHosting","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-use-logrotate-to-manage-logs-on-ubuntu\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-use-logrotate-to-manage-logs-on-ubuntu\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2017\/01\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu.jpg","datePublished":"2017-01-20T13:46:02+00:00","dateModified":"2022-06-03T08:42:22+00:00","description":"How to Use Logrotate to Manage Logs on Ubuntu | RoseHosting","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-use-logrotate-to-manage-logs-on-ubuntu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/how-to-use-logrotate-to-manage-logs-on-ubuntu\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-use-logrotate-to-manage-logs-on-ubuntu\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2017\/01\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu.jpg","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2017\/01\/How-to-Use-Logrotate-to-Manage-Logs-on-Ubuntu.jpg","width":1200,"height":600,"caption":"How to Use Logrotate to Manage Logs on Ubuntu"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-use-logrotate-to-manage-logs-on-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Use Logrotate to Manage Logs on Ubuntu"}]},{"@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\/21105","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=21105"}],"version-history":[{"count":1,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/21105\/revisions"}],"predecessor-version":[{"id":41898,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/21105\/revisions\/41898"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/24951"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=21105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=21105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=21105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}