- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Scheduling logrotate
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-20-2004 02:31 AM
тАО01-20-2004 02:31 AM
Scheduling logrotate
Where and how do you tell logrotate which day to perform weekly or monthly rotations?
Is there a separate parameter file or do you have to schedule it at different times with different configuration files.
We run logrotate daily via cron and the weeklies are performed on Sunday. I beleive the default for monthly would be the 1st of the month.
What if you want to rotate logs on the first Sturday of the weekl or the first non business day of the month?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-20-2004 02:39 AM
тАО01-20-2004 02:39 AM
Re: Scheduling logrotate
logroate is custom, I've never heard of it before. I wrote my own.
man cron
The third column on cron times is day iof the month.
To have your logroate run on the first day of the month at 4 14 am it looks like this
15 4 1 * * /usr/contrib/bin/logroate
Let me know if I need to elaborate further.
The system will rotate logs on its own, perhaps thats a program called logrotate, I've not bothered to check. Mine get to big, so I do it more often.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-20-2004 06:48 AM
тАО01-20-2004 06:48 AM
Re: Scheduling logrotate
The explanation for monthly is pretty clear:
monthly
Log files are rotated the first time logrotate is
run in a month (this is normally on the first day
of the month).
One way around this might be to break your daily, weekly, and monthly logrotate activities out to different configuration files and shedule these independently using cron.
Greetings, Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2004 01:35 AM
тАО01-21-2004 01:35 AM
Re: Scheduling logrotate
Rgds,
Vitaly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2004 01:56 AM
тАО01-21-2004 01:56 AM
Re: Scheduling logrotate
From the logrotate manual:
monthly
Log files are rotated the first time logrotate is run in a month (this is normally on the first day of the month).
That means that if you're running a RedHat installation logrotate is scheduled every day:
/etc/cron.daily/logrotate
All this does is run logrotate with a config file, /etc/logrotate.conf.
You can easily fix your problem as follows:
- move the monthly config files from /etc/logrotate.d/ directory (or they will still be run on a normal schedule), place them in /etc/logrotate_monthly.d/,
- create a new config file /etc/logrotate_monthly.conf and point the include to /etc/logrotate_monthly.d/.
- Remove any parts not owned by any package.
Now schedule this new logrotate process to run whenever you want it to, using crontab for instance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2004 02:11 AM
тАО01-21-2004 02:11 AM
Re: Scheduling logrotate
Thanks for the answers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2004 03:35 AM
тАО01-21-2004 03:35 AM
Re: Scheduling logrotate
for force, meaning rotate now.
You can have your cron daemon run logrotate with the -f parameter on any schedule you set(see my first post on cron).
I didn't know that until I researched your thread.
There seems to be no underlying parameter file.
cron is a good enough tool to run logroate more often. I'm probably going to switch my log rotation script to run logroate instead for the sake of simplicity.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com