Error Line Too Long In State File /var/lib/logrotate.status
in state file - logrotate.status August 7, 2014, 07:41 2 Comments A while ago i noticed that /var partition on a certain server was almost filled up to a 100% up and started researching what caused this.I noticed that log files in /var/log directory were not rotating. I decided to run the log rotation manually when i got this error "error: bad top line in state file /var/lib/logrotate.status".It was the first time i ever say this error and the fact that the logs stopped rotating was bad news! I needed to fix it asap! Error: bad top line in state file - logrotate.status (Img Source: http://www.thegeekstuff.com/)Let's fix "error: bad top line in state file /var/lib/logrotate.status"!Since my log files were not rotating i decided to run logrotate manually to see what the problem was. You can run logrotate very simply bi running the logrotate command and pointing to the desired logrotate configuration file.This is how we run logrotate manually for all logrotate configuration files in /etc/logrotate.d directory:[root@geekpeek ~]# logrotate /etc/logrotate.d/* error: bad top line in state file /var/lib/logrotate.status error: could not read state file, will not attempt to write into itAs we can see, logrotate stopped with an error about logrotate.status file. It says it will not even attempt to write into it which already implies to the solution of this problem.Due to the error i got when running logrotate manually, i decided to backup logrotate.status file by moving (renameing) it:[root@geekpeek ~]# mv /var/lib/logrotate.status /var/lib/logrotate.status.origLet's try running logrotate again and hopefully not see the "error: bad top line in state file /var/lib/logrotate.status" again:[root@geekpeek ~]# logrotate /etc/logrotate.d/* [root@geekpeek ~]#Voila success! The error did not appear again, seems like our solution worked. Let's just check if logrotate.status file was successfully recreated by listing the file:[root@geekpeek ~]# ll /var/lib/logrotate.status -rw-r--r-- 1 root root 225 Aug 7 08:16 /var/lib/logrotate.statusBeautiful! We are done!If you are still having problems and your logrotate.status file was not recreated you might try forcing the logrotate by adding t
Search HCL Search Reviews Search ISOs Go to Page... LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie a question about logrotate? User Name Remember Me? Password Linux - Newbie This Linux forum is for members that are new to Linux. Just starting out and have a question? If it is not in the man pages or the how-to's this is the place! Notices Welcome to LinuxQuestions.org, a friendly and active Linux Community. You are currently viewing LQ as a guest. By joining our community you will have the ability to post https://geekpeek.net/error-bad-top-line-in-state-file/ topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today! Note that registered members see fewer ads, and ContentLink is completely disabled once you log in. Are you new to LinuxQuestions.org? Visit the following links: Site Howto | Site FAQ | Sitemap | Register Now If you http://www.linuxquestions.org/questions/linux-newbie-8/a-question-about-logrotate-379423/ have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here. Having a problem logging in? Please visit this page to clear all LQ-related cookies. Introduction to Linux - A Hands on Guide This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter. For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own. Click Here to receive this Complete Guide absolutely free. Search this Thread 11-02-2005, 07:40 PM #1 hueofwind Member Registered: Nov 2005 Location: Australia Posts: 49 Rep: a question about logrotate? I always have such error informatio
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta http://serverfault.com/questions/388066/logrotate-not-working Discuss the workings and policies of this site About Us Learn more https://bugs.debian.org/118466 about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute: error line Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Logrotate not working up vote 15 down vote favorite 2 I am trying to get logrotate to work on my VPS to rotate my apache files weekly. Currently the contents of the apache2 config error line too file is as such. "/var/www/user/site.com/logs/*.log" { weekly missingok rotate 8 compress delaycompress notifempty create 640 root adm sharedscripts postrotate /etc/init.d/apache2 reload > /dev/null endscript } I've left it for two weeks now and nothing has changed as far as I can tell. When I simulate it from the command line I get the following output. user@geneva:/var/lib/logrotate$ /usr/sbin/logrotate -d /etc/logrotate.d/apache2 reading config file /etc/logrotate.d/apache2 reading config info for "/var/www/user/site.com/logs/*.log" Handling 1 logs rotating pattern: "/var/www/user/site.com/logs/*.log" weekly (8 rotations) empty log files are not rotated, old logs are removed considering log /var/www/user/site.com/logs/access.log log does not need rotating considering log /var/www/user/site.com/logs/error.log log does not need rotating not running postrotate script, since no logs were rotated Any ideas as to what Iv'e configured wrong? My status file is empty too :( user@geneva:~$ cat /var/lib/logrotate/status logrotate state -- version 2 Update I deleted the status file and did a force run of logrotate and now the logs look like they have been rotated and the status file looks more promising! sudo rm /var/lib/logrotate/status sudo /usr/sbin/logrotate -f /etc/logrotate.conf lo
Tue, 6 Nov 2001 11:33:01 UTC Severity: important Tags: patch Found in version 3.5.9-1 Fixed in versions logrotate/3.5.9-2, logrotate/3.5.9-4 Done: Paul Martin