LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
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


Reply
  Search this Thread
Old 08-17-2012, 04:07 AM   #1
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Rep: Reputation: 46
Logs not rotating


Hi guys. I looked in /var/log on one of my older servers, and noticed the logs weren't rotating. so i went to /etc/cron.daily and tried to run a ./logrotate since i saw /etc/cron.daily/logrotate was setup as a cron job.
When i ran the ./logrotate, i got the following errors and it doesn't appear that any of the logs created new files. Any ideas how I can fix this?

error: bad year 1992 for file /var/log/cups/access_log in state file /var/lib/logrotate.status
error: could not read state file, will not attempt to write into it
 
Old 08-17-2012, 04:10 AM   #2
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
Here's the /var/lig/logrotate.status file

logrotate state -- version 2
"/var/log/acpid" 2006-12-29
"/var/log/cups/access_log" 1992-8-23
"/var/log/cups/error_log" 1992-8-23
"/var/log/httpd/*log" 2006-12-29
"/var/log/mgetty.log.tty[^.]" 2006-12-29
"/var/log/mgetty.log.tty[^.][^.]" 2006-12-29
"/var/log/mgetty.log.tty[^.][^.][^.]" 2006-12-29
"/var/log/mgetty.log.tty[^.][^.][^.][^.]" 2006-12-29
"/var/log/mgetty.log.tty[^.][^.][^.][^.][^.]" 2006-12-29
"/var/log/mgetty.log.tty[^.][^.][^.][^.][^.][^.]" 2006-12-29
"/var/log/mgetty.log.tty[^.][^.][^.][^.][^.][^.][^.]" 2006-12-29
"/var/log/mgetty.log.tty[^.][^.][^.][^.][^.][^.][^.][^.]" 2006-12-29
"/var/log/mgetty.log.tty[^.][^.][^.][^.][^.][^.][^.][^.][^.]" 2006-12-29
"/var/log/mgetty.log.tty[^.][^.][^.][^.][^.][^.][^.][^.][^.][^.]" 2006-12-29
"/var/log/mgetty.log.unknown" 2006-12-29
"/var/log/mgetty.callback" 2006-12-29
"/var/log/ppp/connect-errors" 2006-12-29
"/var/account/pacct" 2006-12-29
"/var/log/rpmpkgs" 1992-8-23
"/var/log/samba/*.log" 2006-12-29
"/var/log/squid/access.log" 2006-12-29
"/var/log/squid/cache.log" 2006-12-29
"/var/log/squid/store.log" 2006-12-29
"/var/log/messages" 1992-8-23
"/var/log/secure" 1992-8-23
"/var/log/maillog" 1992-8-23
"/var/log/spooler" 1992-8-23
"/var/log/boot.log" 1992-8-23
"/var/log/cron" 1992-8-23
"/var/log/tux" 2006-12-29
"/var/log/up2date" 1992-8-23
"/var/log/xferlog" 1992-8-23
"/var/log/wtmp" 1992-8-23
"/var/log/samba/nmbd.log" 1992-8-23
"/var/log/samba/smbd.log" 1992-8-23
"/var/log/sa-update.log" 2007-3-10
"/var/log/httpd/access_log" 1992-8-23
"/var/log/httpd/error_log" 1992-8-23
"/var/log/httpd/ssl_access_log" 2012-2-25
"/var/log/httpd/ssl_error_log" 1992-8-23
"/var/log/httpd/ssl_request_log" 2012-2-25
"/var/log/vsftpd.log" 2009-10-2
 
Old 08-17-2012, 06:22 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
Quote:
Originally Posted by rjo98 View Post
error: could not read state file, will not attempt to write into it
Code:
mv -f /var/lib/logrotate.status /var/lib/logrotate.status.$$; touch /var/lib/logrotate.status; 
chown 0:0 /var/lib/logrotate.status; chmod 0644 /var/lib/logrotate.status; 
# test:
/usr/sbin/logrotate -d /etc/logrotate.conf
# and force run:
/usr/sbin/logrotate -f /etc/logrotate.conf
 
1 members found this post helpful.
Old 08-17-2012, 06:26 AM   #4
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
That did it! thanks unSpawn. but what does that $$ do exactly? looks like it put numbers in for that, but not sure why.
 
Old 08-17-2012, 07:16 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
The PID of your current shell session.
 
1 members found this post helpful.
Old 08-17-2012, 07:16 AM   #6
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
oh ok, thanks for all the help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Logs not rotating Arty Ziff Linux - Server 5 01-04-2011 02:51 AM
Rotating logs in squid 2.7 stable9 arunabh_biswas Linux - Server 3 08-16-2010 03:18 AM
Rotating Apache logs and Webalizer xMeta4x Linux - Software 5 03-20-2009 01:42 AM
Samba logs rotating like crazy josephswagner Linux - Software 1 07-07-2004 10:55 AM
problems rotating logs uros678 Linux - Software 0 12-15-2003 03:55 AM


All times are GMT -5. The time now is 10:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration