LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-05-2012, 03:09 AM   #1
farazinux
LQ Newbie
 
Registered: Dec 2012
Posts: 23

Rep: Reputation: Disabled
logrotate


Hi,
How do I change time of daily logrotate? ( hour and minute )
I know when set daily configure for logrotate , this uses cron.daily setting. but I want to distinguish between logrotates ( for example : apache logrotate, daliy : 04:00AM , and syslog daily 06:00 AM )
thanks
 
Old 12-05-2012, 04:31 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
i'd really suggest you don't bother, what are you goign to benefit from changing something that is working just fine on millions and millions of servers worldwide?

If you really have to, you'd need to split the logrotate configs out to separate files and call each on directly from a new cron entry, referencing a different config, e.g. logrotate-messages.conf. I really wouldn't do this though.
 
Old 12-05-2012, 05:14 AM   #3
farazinux
LQ Newbie
 
Registered: Dec 2012
Posts: 23

Original Poster
Rep: Reputation: Disabled
I know this fact about logrotate, but server status is critical at this time!
When logrotate script runs , load average goes up and services would be disrupted!
I need to resolve this problem , just at this time not forever!
thanks
 
Old 12-05-2012, 05:20 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
I agree it doesn't make sense but
Quote:
Originally Posted by farazinux View Post
I want to distinguish between logrotates ( for example : apache logrotate, daliy : 04:00AM , and syslog daily 06:00 AM )
should you want to do it anyway then
Code:
mkdir /etc/logrotate_custom.d; mv /etc/logrotate.d/{http,syslog}* /etc/logrotate_custom.d/
and use the output of
Code:
find /etc/logrotate_custom.d/ -type f -printf '* 4 * * * root /usr/sbin/logrotate -f %p\n'
as an example of what to tweak and add to /etc/crontab. After that you're responsible for the extra maintenance burden so document it and don't complain if something breaks.
 
Old 12-05-2012, 05:22 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by farazinux View Post
When logrotate script runs , load average goes up and services would be disrupted!
Then find out the cause or send logs to a central syslog server for processing there?
 
Old 12-05-2012, 05:26 AM   #6
farazinux
LQ Newbie
 
Registered: Dec 2012
Posts: 23

Original Poster
Rep: Reputation: Disabled
cause of this problem is constraint of hardware on this server( RAM & CPU). I decide to migrate to another server, but I need to resolve this problem at this time,
thanks
 
Old 12-05-2012, 06:21 AM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by farazinux View Post
cause of this problem is constraint of hardware on this server( RAM & CPU).
Unless you use prerotate / postrotate processing in the logrotate script all it does is delete the oldest log, create a new file and possibly compress the rotated log. So find out what exactly is hogging resources. On newer machines you could check if you could wedge the process into some low-priority cgroup, on older machines you could try execute that logrotate instance with ionice + nice (though child processes like gzip don't inherit any ionicing IIRC) or if logs are way large you could opt for processing them multiple times a day instead. Using a separate syslog server alleviates all of that.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Logrotate help ayush1440 Linux - Newbie 3 03-20-2012 06:31 AM
[SOLVED] logrotate or logrotate.conf; problems with sftp slufoot80 Linux - Server 1 11-05-2011 07:50 AM
About logrotate satimis *BSD 1 05-27-2007 01:08 PM
Logrotate Help! MaverickApollo Linux - Software 3 02-19-2004 12:09 PM
logrotate Rig24 Linux - Newbie 2 07-11-2003 05:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration