Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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 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.
If you 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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
When i set the computer up, I ran it for awhile before I thougt about syncing the clock to a network time server, so it thought it was the 70's all over again. Time is set up correctly now, but could this possibly be what is keeping my logs from rotating? And what exactly do I do to fix.. delete the contents of that last file?
Well, the old dates are really only a part of the "/var/lib/logrotate.status" file... the actual files themselves in /etc/log/* all reflect current date/time-stamps (except for the files that don't get logged to because I don't use the service -- like cups).
So, pretty much all the files in the httpd directory (access_log, agent_log, etc), all have time-stamps of today.
I did notice something odd in "/etc/logrotate.d/":
Code:
total 48
-rwxr-xr-x 1 root root 161 Aug 14 13:24 cups*
-rw-r--r-- 1 root root 202 Dec 17 09:36 httpd
-rw-r--r-- 1 root root 345 Jun 1 2004 mysqld
-rw-r--r-- 1 root root 163 May 25 2004 named
-rw-r--r-- 1 root root 136 Aug 14 19:02 ppp
-rw-r--r-- 1 root root 242 May 25 2004 psacct
-rw-r--r-- 1 root root 61 May 18 2004 rpm
-rw-r--r-- 1 root root 232 May 26 2004 samba
-rw-r--r-- 1 root root 543 Aug 16 15:04 squid
-rw-r--r-- 1 root root 228 May 19 2004 syslog
-rw-r--r-- 1 root root 48 Jun 7 2004 tux
-rw-r--r-- 1 root root 89 Jun 3 2004 yum
The cups script is a+x, while none of the others are. Now, I'm not using cups, so the log isn't getting written to, so if these files need to be set executable for logrotate to run them, I'd never know based off just cups being set that way.
I've set the httpd script a+x to match cups, and I guess we'll see if that solves the problem, but I don't understand why this installation set up logrotate.d like this... seems odd for a default server install.
If you recognize that this is probabaly the cause of my problem, I certainly wouldn't mind you posting back to let me know... otherwise, I guess we'll wait until tonite to see.
As an aside -- there's no specific reason you picked 2004-10-11 is there? It doesn't appear anywhere else really... your birthday, maybe? (Or you really like Eleanor Roosevelt.)
All logs seem to be getting rotated correctly now.
The solution was Tink's updating of the logrotate state file with:
sed -i 's/1970-1-11/2004-10-11/g' var/lib/logrotate.status
Seemed to do the trick.
My suggestion that setting the executable bit on the httpd script in /etc/logrotate.d couldn't have been the solution because as of now, there are only two scripts in that file with executable bits set - the httpd and cups scripts - and many more logs than those associated with those two scripts have been rotated by cron overnite.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.