{"id":4420,"date":"2017-03-09T16:03:02","date_gmt":"2017-03-09T16:03:02","guid":{"rendered":"http:\/\/hostileblog.com\/?p=4420"},"modified":"2020-05-30T21:35:30","modified_gmt":"2020-05-31T01:35:30","slug":"fix-logrotate-not-working-problem","status":"publish","type":"post","link":"https:\/\/www.carnaghan.com\/fix-logrotate-not-working-problem\/","title":{"rendered":"How to fix logrotate not working problem?"},"content":{"rendered":"\n
If your app<\/span> is appending the errors and website visitor’s IP address, browser data, etc to a log<\/span> file, you should manually archive<\/span> old log<\/span> files or use Logrotate.<\/p>\n\n\n\n If you don’t do so, the server<\/span> will run out of storage memory<\/a> and your application<\/span> may crash.<\/p>\n\n\n\n Logrotate is a powerful program<\/span> that archives and removes old log<\/span> files. It saves heaps of storage memory by automatically compressing log<\/span> files generated by Apache<\/span>, NGINX, MySQL<\/span>, etc.<\/p>\n\n\n\n The tool has two main modules, a script<\/span> that executes the task<\/span> of rotating logs<\/span> and a configuration file.<\/p>\n\n\n\n When you install and start the web or a database server<\/a>, Logrotate creates a configuration file for the same in the Logrotate directory.<\/p>\n\n\n\n For example, If you have installed and started Apache<\/span> web server<\/span>, Logrotate will create apache config file.<\/p>\n\n\n\n Unless you make changes to the config file, the tool will rotate log<\/span> files saved in the \/var\/log<\/span> directory.<\/p>\n\n\n\n By default, the script<\/span> that runs the task of rotating logs is saved in the cron.daily folder which means that the script<\/span> is executed once in a day.<\/p>\n\n\n\n Yesterday, I made some changes to the Anacron<\/a> configuration file and changed the value<\/span> of variable<\/span> START_HOURS_RANGE of the Anacrontab.<\/p>\n\n\n\nLogrotate not working error<\/h2>\n\n\n\n