logrotate.conf | Unix Linux Forums | UNIX for Advanced & Expert Users

  Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

logrotate.conf

UNIX for Advanced & Expert Users


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-15-2006
fredao fredao is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 6 April 2009, 9:07 PM EDT
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
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?
Sponsored Links
    #2  
Old 12-15-2006
silicate silicate is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 15 February 2008, 10:33 AM EST
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Sponsored Links
    #3  
Old 12-18-2006
fredao fredao is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 6 April 2009, 9:07 PM EDT
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
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?
    #4  
Old 12-18-2006
silicate silicate is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 15 February 2008, 10:33 AM EST
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
do you have the logrotate setup on a cron job?
Sponsored Links
    #5  
Old 12-18-2006
fredao fredao is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 6 April 2009, 9:07 PM EDT
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Sponsored Links
    #6  
Old 12-18-2006
silicate silicate is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 15 February 2008, 10:33 AM EST
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
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
Sponsored Links
    #7  
Old 12-18-2006
fredao fredao is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 6 April 2009, 9:07 PM EDT
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Some questions about Logrotate.conf idro Red Hat 5 03-25-2010 01:06 PM
logrotate with /etc/logrotate.conf file skmdu UNIX for Advanced & Expert Users 2 10-17-2009 08:04 AM
basic question on sd.conf and lpc.conf file mokkan Solaris 4 08-14-2009 03:29 PM
Configuring snmpd.conf and snmptrapd.conf jagdish.machhi@ UNIX for Advanced & Expert Users 2 04-17-2008 04:01 PM
how to set size in logrotate.conf icehero UNIX for Dummies Questions & Answers 0 02-24-2008 04:41 AM



All times are GMT -4. The time now is 05:38 PM.