{"id":240962,"date":"2022-10-28T10:30:14","date_gmt":"2022-10-28T17:30:14","guid":{"rendered":"https:\/\/virtual-dba.com\/?p=240962"},"modified":"2022-10-28T14:15:22","modified_gmt":"2022-10-28T21:15:22","slug":"automating-log-rotation-with-logrotate","status":"publish","type":"post","link":"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/","title":{"rendered":"Automating Log Rotation with Logrotate"},"content":{"rendered":"\n<p>Rotating MySQL logs is important because logs can take up a lot of disk space if left unmanaged. For example, an untuned database can lead to a lot of slow queries being logged. The error log can become large if it includes notes and warnings. Additionally, binlogs track every data modification statement like INSERT, DELETE, and UPDATE. If you are dropping a lot of tables, expect the binlogs to take up a lot of disk space, sometimes very quickly. The good news is that rotating MySQL logs can be automated with a system utility tool that is likely to already be installed on your operating system (OS), called logrotate.<\/p>\n\n\n\n<p>A quick and easy way to check if logrotate is already installed is by using the following command, knowing the version is also useful since there are subtle differences in versions.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ logrotate \u2013-version<\/code><\/pre>\n\n\n\n<p>Despite the differences, configuration is pretty straightforward and easy in any version.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Configuring Logrotate<\/strong><\/h2>\n\n\n\n<p>The logrotate script is installed into the \/etc\/cron.daily directory and will run daily as root user so no need to create a cronjob. I recommend leaving the script in this directory and modifying the configuration file if you want to rotate the logs weekly or monthly.<\/p>\n\n\n\n<p>There are two logrotate configuration files. The main configuration file is located at \/etc\/logrotate.conf. The sample below, from v. 3.8.6, shows how intuitive it is to set up. On line 3, the log rotation is set to once a week, or weekly. This can be changed to daily or monthly. For binlogs, the value for expire_days will override this entry if the value is fewer days. Uncomment line 15 if you want the log files to be compressed upon rotation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># see \"man logrotate\" for details\n# rotate log files weekly\nweekly\n\n# keep 4 weeks worth of backlogs\nrotate 4\n\n# create new (empty) log files after rotating old ones\ncreate\n\n# use date as a suffix of the rotated file\ndateext\n\n# uncomment this if you want your log files compressed\n#compress\n\n# RPM packages drop log rotation information into this directory\ninclude \/etc\/logrotate.d\n\n# no packages own wtmp and btmp -- we'll rotate them here\n\/var\/log\/wtmp {\n    monthly\n    create 0664 root utmp\n        minsize 1M\n    rotate 1\n}\n\n\/var\/log\/btmp {\n    missingok\n    monthly\n    create 0600 root utmp\n    rotate 1\n}\n\n# system-specific logs may also be configured here.<\/code><\/pre>\n\n\n\n<p>Line 18 includes other configuration files found in the \/etc\/logrotate.d directory, which includes mysql-server (v 3.14.0 example below).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># - I put everything in one block and added sharedscripts, so that mysql gets \n#   flush-logs'd only once.\n#   Else the binary logs would automatically increase by n times every day.\n# - The error log is obsolete, messages go to syslog now.\n\/var\/log\/mysql.log \/var\/log\/mysql\/*log {\n\tdaily\n\trotate 7\n\tmissingok\n\tcreate 640 mysql adm\n\tcompress\n\tsharedscripts\n\tpostrotate\n\t\ttest -x \/usr\/bin\/mysqladmin || exit 0\n\t\t# If this fails, check debian.conf! \n\t\tMYADMIN=\"\/usr\/bin\/mysqladmin --defaults-file=\/etc\/mysql\/debian.cnf\"\n\t\tif &#91; -z \"`$MYADMIN ping 2&gt;\/dev\/null`\" ]; then\n\t\t  # Really no mysqld or rather a missing debian-sys-maint user?\n\t\t  # If this occurs and is not a error please report a bug.\n\t\t  #if ps cax | grep -q mysqld; then\n\t\t  if killall -q -s0 -umysql mysqld; then\n \t\t    exit 1\n\t\t  fi \n\t\telse\n\t\t  $MYADMIN flush-logs\n\t\tfi\n\tendscript\n}<\/code><\/pre>\n\n\n\n<p>The first uncommented line lists the log files that will be rotated. In between the brackets are the directives, also known as options, that control the log rotation. The table below defines the directives included above. Another useful directive is minsize &lt;size&gt;, which will rotate the logs when it grows larger than the specified size. A full list of directives can be found <a href=\"https:\/\/linux.die.net\/man\/8\/logrotate\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Directive<\/td><td>Function<\/td><td>Other Options<\/td><\/tr><tr><td><code>daily<\/code><\/td><td>Rotates the logs daily.<\/td><td><code>hourly&nbsp;<\/code><br><code>weekly&nbsp;<\/code><br><code>monthly<\/code><br><code>yearly<\/code><\/td><\/tr><tr><td><code>rotate 7<\/code><\/td><td>Keeps 7 days worth of backlogs.<\/td><td>Number of days can be changed.&nbsp;<\/td><\/tr><tr><td><code>missingok<\/code><\/td><td>Will not throw an error message if a log file is missing.<\/td><td><code>nomissingok<\/code> &#8211; will throw an error if a log file is missing.<\/td><\/tr><tr><td><code>create 640 mysql admin<\/code><\/td><td>Specifies the mode, owner, and group of the log file created.<\/td><td><code>nocreate<\/code> &#8211; disables or overrides the create option.<\/td><\/tr><tr><td><code>compress<\/code><\/td><td>Backlogs are compressed using <code>gzip<\/code>.<\/td><td><code>compresscmd<\/code> used to change the default (<code>gzip<\/code>) command to another command to compress log files.<br><br><code>compressext<\/code> &#8211; if compression is enabled, specifies an extension to use on compressed log files.<br><br><code>compressoptions<\/code> &#8211; if compression is enabled, specifies the compression options that are passed by logrotate on the command line.<\/td><\/tr><tr><td><code>sharedscripts<\/code><\/td><td>Runs the script and its options once for all logs that require rotating.<br><br>Will override <code>nosharescripts<\/code> option and implies <code>create<\/code> option.<\/td><td><code>nosharescripts<\/code> &#8211; runs <code>prerotate<\/code> and <code>postrotate<\/code> scripts for every log file.<\/td><\/tr><tr><td><code>postrotate\/endscript<\/code><\/td><td>After the log file is rotated, any command between <code>postrotate<\/code> and <code>endscript<\/code> will be run using \/bin\/sh.<\/td><td><code>prerotate\/endscript<\/code> &#8211; before the log file is rotated, any command between <code>pretrotate<\/code> and <code>endscript<\/code> will be run using \/bin\/sh.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Prior to logrotate version 3.14.0, this configuration file will look different. For instance, the paths for the log files are based on earlier MySQL versions. Additionally, a hidden file needs to be created if the MySQL root user has a password, which it definitely should. Handy instructions are included at the top of the configuration file (example below).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># If the root user has a password you have to create a\n# \/root\/.my.cnf configuration file with the following\n# content:\n#\n# &#91;mysqladmin]\n# password = &lt;secret&gt;\n# user= root\n#\n# where \"&lt;secret&gt;\" is the password.\n#\n# ATTENTION: This \/root\/.my.cnf should be readable ONLY\n# for root !<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Debugging<\/strong><\/h2>\n\n\n\n<p>Even though configuration is easy, its technology. Things can still not work on the first try. If this is the case, logrotate can be executed on the command line with the <code>--debug option<\/code> (syntax below).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo logrotate \/etc\/logrotate.conf --debug<\/code><\/pre>\n\n\n\n<p>I am a big fan of using the <code>--verbose option<\/code>. Similar to <code>--debug<\/code>, it can be run on the command line. The difference is that it prints everything that the logrotate is doing and not doing.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo logrotate \/etc\/logrotate.conf --verbose<\/code><\/pre>\n\n\n\n<p>Last but not least, the manual can be accessed using the following syntax.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ man logrotate<\/code><\/pre>\n\n\n\n<p>Please be sure to <a href=\"https:\/\/virtual-dba.com\/contact-us\/\">contact us<\/a> for any questions or more information!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Rotating MySQL logs is important because logs can take up a lot of disk space if left unmanaged. For example, an untuned database can lead to a lot of slow queries being logged. The error log can become large if it includes notes and warnings. Additionally, binlogs track every data modification statement like INSERT, DELETE, [&hellip;]<\/p>\n","protected":false},"author":49,"featured_media":240963,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"off","_et_pb_old_content":"","_et_gb_content_width":"","content-type":"","footnotes":""},"categories":[4166,3918,39],"tags":[4195,4118,4196,4194],"class_list":["post-240962","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","category-database","category-mysql","tag-datamanagement","tag-mysqlbinlog","tag-mysqlconfiguration","tag-mysqlperformance"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.1 (Yoast SEO v27.1.1) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Automating Log Rotation with Logrotate<\/title>\n<meta name=\"description\" content=\"How rotating MySQL logs can be automated with a system utility tool most likely already installed on your operating system, called logrotate.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Automating Log Rotation with Logrotate\" \/>\n<meta property=\"og:description\" content=\"How rotating MySQL logs can be automated with a system utility tool most likely already installed on your operating system, called logrotate.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/\" \/>\n<meta property=\"og:site_name\" content=\"Virtual-DBA Remote DBA Services &amp; Support - Certified Database Experts\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-28T17:30:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-10-28T21:15:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/virtual-dba.com\/wp-content\/uploads\/Automating-Log-Rotation-with-Logrotate.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"557\" \/>\n\t<meta property=\"og:image:height\" content=\"291\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Monica Silva\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@virtual_dba\" \/>\n<meta name=\"twitter:site\" content=\"@virtual_dba\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Monica Silva\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/\"},\"author\":{\"name\":\"Monica Silva\",\"@id\":\"https:\/\/virtual-dba.com\/#\/schema\/person\/9326f6340815aef31d91f56e4ba145da\"},\"headline\":\"Automating Log Rotation with Logrotate\",\"datePublished\":\"2022-10-28T17:30:14+00:00\",\"dateModified\":\"2022-10-28T21:15:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/\"},\"wordCount\":690,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/virtual-dba.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/virtual-dba.com\/wp-content\/uploads\/Automating-Log-Rotation-with-Logrotate.jpg\",\"keywords\":[\"datamanagement\",\"mysqlbinlog\",\"mysqlconfiguration\",\"mysqlperformance\"],\"articleSection\":[\"Blog\",\"Database\",\"MySQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/\",\"url\":\"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/\",\"name\":\"Automating Log Rotation with Logrotate\",\"isPartOf\":{\"@id\":\"https:\/\/virtual-dba.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/virtual-dba.com\/wp-content\/uploads\/Automating-Log-Rotation-with-Logrotate.jpg\",\"datePublished\":\"2022-10-28T17:30:14+00:00\",\"dateModified\":\"2022-10-28T21:15:22+00:00\",\"description\":\"How rotating MySQL logs can be automated with a system utility tool most likely already installed on your operating system, called logrotate.\",\"breadcrumb\":{\"@id\":\"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/#primaryimage\",\"url\":\"https:\/\/virtual-dba.com\/wp-content\/uploads\/Automating-Log-Rotation-with-Logrotate.jpg\",\"contentUrl\":\"https:\/\/virtual-dba.com\/wp-content\/uploads\/Automating-Log-Rotation-with-Logrotate.jpg\",\"width\":557,\"height\":291,\"caption\":\"Automating Log Rotation with Logrotate\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/virtual-dba.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Automating Log Rotation with Logrotate\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/virtual-dba.com\/#website\",\"url\":\"https:\/\/virtual-dba.com\/\",\"name\":\"Virtual-DBA Remote DBA Services &amp; Support - Certified Database Experts\",\"description\":\"Remote Database Administration\",\"publisher\":{\"@id\":\"https:\/\/virtual-dba.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/virtual-dba.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/virtual-dba.com\/#organization\",\"name\":\"Virtual-DBA: Remote DBA | Remote Database Administration\",\"alternateName\":\"Virtual-DBA powered by XTIVIA\",\"url\":\"https:\/\/virtual-dba.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/virtual-dba.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/virtual-dba.com\/wp-content\/uploads\/V-DBA-Database-Services-and-Support-Featured-Logo.jpg\",\"contentUrl\":\"https:\/\/virtual-dba.com\/wp-content\/uploads\/V-DBA-Database-Services-and-Support-Featured-Logo.jpg\",\"width\":557,\"height\":291,\"caption\":\"Virtual-DBA: Remote DBA | Remote Database Administration\"},\"image\":{\"@id\":\"https:\/\/virtual-dba.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/virtual_dba\",\"https:\/\/www.linkedin.com\/showcase\/36220649\/\",\"https:\/\/www.youtube.com\/channel\/UCx3AIeUQ2ziTLKZSJDZ-SEg\"],\"description\":\"Eliminate database downtime and spiraling costs with XTIVIA\u2019s Virtual-DBA. In today\u2019s always-on business world, gaps in 24x7 on-call DBA support, neglected maintenance and security, or a stretched team struggling with overwhelming workloads can lead to costly disruptions and threaten business continuity. XTIVIA\u2019s Virtual-DBA provides the immediate, expert database administration you need, exactly when you need it, ensuring optimal performance, ironclad security, and significant cost savings without the burden of expanding your in-house team. The goal of Virtual-DBA is to provide a cost-effective solution for organizations seeking to optimize the security, management, maintenance, availability, and performance of their critical business systems, whether self-managed or cloud-managed (e.g., AWS RDS, Azure SQL Database). We accomplish this through a comprehensive remote DBA service offering designed specifically to meet the Oracle\u00ae, DB2\u00ae, Informix\u00ae, MySQL\u2122, PostgreSQL\u00ae, MongoDB\u00ae, MariaDB, and Microsoft SQL Server\u00ae, CockroachDB, Databricks, AWS, and Azure needs of our clients.\",\"email\":\"info@xtivia.com\",\"telephone\":\"8886853101\",\"legalName\":\"XTIVIA, Inc\",\"foundingDate\":\"1992-05-01\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"201\",\"maxValue\":\"500\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/virtual-dba.com\/#\/schema\/person\/9326f6340815aef31d91f56e4ba145da\",\"name\":\"Monica Silva\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/virtual-dba.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9af003bf84c81e7a65a1816bc03fa96f866c8d4432b67dec463ef4fbcbe2d65d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9af003bf84c81e7a65a1816bc03fa96f866c8d4432b67dec463ef4fbcbe2d65d?s=96&d=mm&r=g\",\"caption\":\"Monica Silva\"},\"url\":\"https:\/\/virtual-dba.com\/author\/monica-silva\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Automating Log Rotation with Logrotate","description":"How rotating MySQL logs can be automated with a system utility tool most likely already installed on your operating system, called logrotate.","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:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/","og_locale":"en_US","og_type":"article","og_title":"Automating Log Rotation with Logrotate","og_description":"How rotating MySQL logs can be automated with a system utility tool most likely already installed on your operating system, called logrotate.","og_url":"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/","og_site_name":"Virtual-DBA Remote DBA Services &amp; Support - Certified Database Experts","article_published_time":"2022-10-28T17:30:14+00:00","article_modified_time":"2022-10-28T21:15:22+00:00","og_image":[{"width":557,"height":291,"url":"https:\/\/virtual-dba.com\/wp-content\/uploads\/Automating-Log-Rotation-with-Logrotate.jpg","type":"image\/jpeg"}],"author":"Monica Silva","twitter_card":"summary_large_image","twitter_creator":"@virtual_dba","twitter_site":"@virtual_dba","twitter_misc":{"Written by":"Monica Silva","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/#article","isPartOf":{"@id":"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/"},"author":{"name":"Monica Silva","@id":"https:\/\/virtual-dba.com\/#\/schema\/person\/9326f6340815aef31d91f56e4ba145da"},"headline":"Automating Log Rotation with Logrotate","datePublished":"2022-10-28T17:30:14+00:00","dateModified":"2022-10-28T21:15:22+00:00","mainEntityOfPage":{"@id":"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/"},"wordCount":690,"commentCount":0,"publisher":{"@id":"https:\/\/virtual-dba.com\/#organization"},"image":{"@id":"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/#primaryimage"},"thumbnailUrl":"https:\/\/virtual-dba.com\/wp-content\/uploads\/Automating-Log-Rotation-with-Logrotate.jpg","keywords":["datamanagement","mysqlbinlog","mysqlconfiguration","mysqlperformance"],"articleSection":["Blog","Database","MySQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/","url":"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/","name":"Automating Log Rotation with Logrotate","isPartOf":{"@id":"https:\/\/virtual-dba.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/#primaryimage"},"image":{"@id":"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/#primaryimage"},"thumbnailUrl":"https:\/\/virtual-dba.com\/wp-content\/uploads\/Automating-Log-Rotation-with-Logrotate.jpg","datePublished":"2022-10-28T17:30:14+00:00","dateModified":"2022-10-28T21:15:22+00:00","description":"How rotating MySQL logs can be automated with a system utility tool most likely already installed on your operating system, called logrotate.","breadcrumb":{"@id":"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/#primaryimage","url":"https:\/\/virtual-dba.com\/wp-content\/uploads\/Automating-Log-Rotation-with-Logrotate.jpg","contentUrl":"https:\/\/virtual-dba.com\/wp-content\/uploads\/Automating-Log-Rotation-with-Logrotate.jpg","width":557,"height":291,"caption":"Automating Log Rotation with Logrotate"},{"@type":"BreadcrumbList","@id":"https:\/\/virtual-dba.com\/blog\/automating-log-rotation-with-logrotate\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/virtual-dba.com\/"},{"@type":"ListItem","position":2,"name":"Automating Log Rotation with Logrotate"}]},{"@type":"WebSite","@id":"https:\/\/virtual-dba.com\/#website","url":"https:\/\/virtual-dba.com\/","name":"Virtual-DBA Remote DBA Services &amp; Support - Certified Database Experts","description":"Remote Database Administration","publisher":{"@id":"https:\/\/virtual-dba.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/virtual-dba.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/virtual-dba.com\/#organization","name":"Virtual-DBA: Remote DBA | Remote Database Administration","alternateName":"Virtual-DBA powered by XTIVIA","url":"https:\/\/virtual-dba.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/virtual-dba.com\/#\/schema\/logo\/image\/","url":"https:\/\/virtual-dba.com\/wp-content\/uploads\/V-DBA-Database-Services-and-Support-Featured-Logo.jpg","contentUrl":"https:\/\/virtual-dba.com\/wp-content\/uploads\/V-DBA-Database-Services-and-Support-Featured-Logo.jpg","width":557,"height":291,"caption":"Virtual-DBA: Remote DBA | Remote Database Administration"},"image":{"@id":"https:\/\/virtual-dba.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/virtual_dba","https:\/\/www.linkedin.com\/showcase\/36220649\/","https:\/\/www.youtube.com\/channel\/UCx3AIeUQ2ziTLKZSJDZ-SEg"],"description":"Eliminate database downtime and spiraling costs with XTIVIA\u2019s Virtual-DBA. In today\u2019s always-on business world, gaps in 24x7 on-call DBA support, neglected maintenance and security, or a stretched team struggling with overwhelming workloads can lead to costly disruptions and threaten business continuity. XTIVIA\u2019s Virtual-DBA provides the immediate, expert database administration you need, exactly when you need it, ensuring optimal performance, ironclad security, and significant cost savings without the burden of expanding your in-house team. The goal of Virtual-DBA is to provide a cost-effective solution for organizations seeking to optimize the security, management, maintenance, availability, and performance of their critical business systems, whether self-managed or cloud-managed (e.g., AWS RDS, Azure SQL Database). We accomplish this through a comprehensive remote DBA service offering designed specifically to meet the Oracle\u00ae, DB2\u00ae, Informix\u00ae, MySQL\u2122, PostgreSQL\u00ae, MongoDB\u00ae, MariaDB, and Microsoft SQL Server\u00ae, CockroachDB, Databricks, AWS, and Azure needs of our clients.","email":"info@xtivia.com","telephone":"8886853101","legalName":"XTIVIA, Inc","foundingDate":"1992-05-01","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"201","maxValue":"500"}},{"@type":"Person","@id":"https:\/\/virtual-dba.com\/#\/schema\/person\/9326f6340815aef31d91f56e4ba145da","name":"Monica Silva","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/virtual-dba.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9af003bf84c81e7a65a1816bc03fa96f866c8d4432b67dec463ef4fbcbe2d65d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9af003bf84c81e7a65a1816bc03fa96f866c8d4432b67dec463ef4fbcbe2d65d?s=96&d=mm&r=g","caption":"Monica Silva"},"url":"https:\/\/virtual-dba.com\/author\/monica-silva\/"}]}},"_links":{"self":[{"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/posts\/240962","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/users\/49"}],"replies":[{"embeddable":true,"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/comments?post=240962"}],"version-history":[{"count":0,"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/posts\/240962\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/media\/240963"}],"wp:attachment":[{"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/media?parent=240962"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/categories?post=240962"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/tags?post=240962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}