The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
passing values into logrotate?? imbiea Shell Programming and Scripting 1 06-09-2008 01:03 PM
Configuring snmpd.conf and snmptrapd.conf jagdish.machhi@ UNIX for Advanced & Expert Users 2 04-17-2008 12:01 PM
Disabling logrotate primal UNIX for Dummies Questions & Answers 2 04-14-2008 10:19 AM
how to set size in logrotate.conf icehero UNIX for Dummies Questions & Answers 0 02-24-2008 12:41 AM
Logrotate problems - Can anyone spot the problem please?! anderow UNIX for Dummies Questions & Answers 10 01-10-2008 04:56 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-15-2006
Registered User
 

Join Date: Dec 2006
Posts: 58
Stumble this Post!
logrotate.conf

I changed the logrotate.conf file to make a new log file to be automatically rotated daily. But after a night, I have not seen the rotated file.

When does this rotation happen? I mean what is the exact time?

In addition, do I have to restart what deamon to make the change take effect?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-15-2006
Registered User
 

Join Date: Dec 2006
Posts: 22
Stumble this Post!
when the logs rotate is defined in the logrotate.conf, you can see more details with "man logrotate"

logrotate is not a deamon, therefore it does not need restarting.

from the man page:
Normally, logrotate is run as a daily cron job. It will not modify a log more than once in one day unless the criterion
for that log is based on the log's size and logrotate is being run more than once each day, or unless the -f or --force
option is used.
Reply With Quote
  #3 (permalink)  
Old 12-18-2006
Registered User
 

Join Date: Dec 2006
Posts: 58
Stumble this Post!
Quote:
Originally Posted by silicate
when the logs rotate is defined in the logrotate.conf, you can see more details with "man logrotate"

logrotate is not a deamon, therefore it does not need restarting.

from the man page:
Normally, logrotate is run as a daily cron job. It will not modify a log more than once in one day unless the criterion
for that log is based on the log's size and logrotate is being run more than once each day, or unless the -f or --force
option is used.

this is the content of my logrotate file for a specific task:

compress
dateext
daily
rotate 7
size 1M
notifempty
missingok
copytruncate

the "daily" statement should indicate that it will rotate each day, namely that a new file will be created each day. however, after several days, I still have only one log file. why?
Reply With Quote
  #4 (permalink)  
Old 12-18-2006
Registered User
 

Join Date: Dec 2006
Posts: 22
Stumble this Post!
do you have the logrotate setup on a cron job?
Reply With Quote
  #5 (permalink)  
Old 12-18-2006
Registered User
 

Join Date: Dec 2006
Posts: 58
Stumble this Post!
Quote:
Originally Posted by silicate
do you have the logrotate setup on a cron job?
I am not sure, but this is what the "ls /etc/cron*" shows:

ls cron*
cron.deny crontab

cron.d:

cron.daily:
beagle-crawl-system suse-clean_catman suse.de-backup-rpmdb suse.de-clean-tmp suse.de-update-preload
logrotate suse.de-backup-rc.config suse.de-check-battery suse.de-cron-local suse-do_mandb

cron.hourly:
mcelog

cron.monthly:

as logrotate is under cron.daily, I assumed it has been set up.
Reply With Quote
  #6 (permalink)  
Old 12-18-2006
Registered User
 

Join Date: Dec 2006
Posts: 22
Stumble this Post!
so as long as inside the cron.daily/logrotate file there is this line: /usr/sbin/logrotate /etc/logrotate.conf

and the cron daemon is running, then it should be working fine.

try running /usr/sbin/logrotate /etc/logrotate.conf

it will rotate the logs, then you can see if it's working at all based on the config file, if not try /usr/sbin/logrotate -f /etc/logrotate.conf
Reply With Quote
  #7 (permalink)  
Old 12-18-2006
Registered User
 

Join Date: Dec 2006
Posts: 58
Stumble this Post!
Quote:
Originally Posted by silicate
so as long as inside the cron.daily/logrotate file there is this line: /usr/sbin/logrotate /etc/logrotate.conf

and the cron daemon is running, then it should be working fine.
what I have is :

/usr/sbin/logrotate /etc/logrotate.conf 2>&1 | tee $TMPF

but the fact is that I still have only one log file there, but there should be a couple of rotated log files right? as I made the configuration a couple of days ago.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:51 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0