epike on Tue, 24 Dec 2002 10:30:33 -0500


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Testing logrotate


logrotate is called like this (m using redhat 7.x):

----------------------------------------------
localhost.localdomain[20]% cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

0-59/5 * * * * root /usr/bin/mrtg /etc/mrtg/mrtg.cfg


localhost.localdomain[21]% ls /etc/cron.daily
00-logwatch  inn-cron-expire  rpm              tetex.cron
00webalizer  logrotate        slocate.cron     tmpwatch
0anacron     makewhatis.cron  slrnpull-expire  tripwire-check
localhost.localdomain[22]% 
localhost.localdomain[22]% cat /etc/cron.daily/logrotate
#!/bin/sh

/usr/sbin/logrotate /etc/logrotate.conf
localhost.localdomain[23]% 
----------------------------------------------



epike


> 
> Really? I though you would need to set up something in cronjob. The man
> page says this: "Normally, logrotate is run as a daily cron job"
> LOGROTATE(8)
> 
> Naresh.
> 
> On Mon, 23 Dec 2002 epike@isinet.com wrote:
> 
> > no i wouldnt do that.....
> > setup /etc/logrotate.conf and /etc/logrotate.d properly.
> > there are schedules in logrotate.d properly (weekly,daily,etc).
> >
> > logrotate itself is already being called (somehow) by cron.
> >
> > jondz
> >
> >
> > >
> > > Cool! I got it working. Would you put the same entry in the crontab, for
> > > example.
> > >
> > > 0 0 1 * * /usr/sbin/logrotate -f /etc/logrotate.conf
> > >
> > >
> > > TIA
> > >
> > > Naresh
> > >
> > > On Mon, 23 Dec 2002 epike@isinet.com wrote:
> > >
> > > > logrotate -f /etc/logrotate.conf will do it, but it will
> > > > do a forced logrotation.  So if your schedule is weekly,
> > > > all those logs will rotate right now.
> > > >
> > > > I use this since I dont mind a forced rotation anyway.
> > > >
> > > > e pike
> > > >
> > > > >
> > > > > i have very large log files, so I decided to setup logrotate. I believe I
> > > > > set up everything up fine, and now I want to test it. What is the best way
> > > > > to do this, so I know its working.
> > > > >
> > > > > Thanks
> > > > > Naresh
> > > >
> > > > _________________________________________________________________________
> > > > Philadelphia Linux Users Group        --       http://www.phillylinux.org
> > > > Announcements - http://lists.netisland.net/mailman/listinfo/plug-announce
> > > > General Discussion  --   http://lists.netisland.net/mailman/listinfo/plug
> > > >
> > > _________________________________________________________________________
> > > Philadelphia Linux Users Group        --       http://www.phillylinux.org
> > > Announcements - http://lists.netisland.net/mailman/listinfo/plug-announce
> > > General Discussion  --   http://lists.netisland.net/mailman/listinfo/plug
> > >
> >
> > _________________________________________________________________________
> > Philadelphia Linux Users Group        --       http://www.phillylinux.org
> > Announcements - http://lists.netisland.net/mailman/listinfo/plug-announce
> > General Discussion  --   http://lists.netisland.net/mailman/listinfo/plug
> >
> _________________________________________________________________________
> Philadelphia Linux Users Group        --       http://www.phillylinux.org
> Announcements - http://lists.netisland.net/mailman/listinfo/plug-announce
> General Discussion  --   http://lists.netisland.net/mailman/listinfo/plug
> 

_________________________________________________________________________
Philadelphia Linux Users Group        --       http://www.phillylinux.org
Announcements - http://lists.netisland.net/mailman/listinfo/plug-announce
General Discussion  --   http://lists.netisland.net/mailman/listinfo/plug