AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-10-2008, 07:39 AM
|
#1
|
|
LQ Newbie
Registered: Jun 2006
Posts: 14
Rep:
|
Logrotate: compress logs in a temp directory
Hello, somebody know how can i configure the logrotate to make this compress a file into a temporal file in the tmp directory and then move it in the original directory again?
Thanks
Last edited by gbratig; 04-10-2008 at 08:01 AM.
|
|
|
|
04-11-2008, 04:50 PM
|
#2
|
|
Member
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 4&5, Fedora 10, CentOS 5.4, IPCop
Posts: 569
Rep:
|
You'll need to check with your man pages, but my logrotate has an option named "compresscmd" that will let you specify the command to use when compressing the log file.
My guess is you could write a script that moved the logfile (probably parameter $1 to your script) and compress it elsewhere before moving it back again.
There is also the "compressoptions" setting which might let you specify parameters to your default compression program that will tell it to use an alternate directory as a work area.
|
|
|
|
04-12-2008, 11:06 AM
|
#3
|
|
LQ Newbie
Registered: Jun 2006
Posts: 14
Original Poster
Rep:
|
Ian, thanks for the reply, i check those flags that you say, but i cant found the way to do that logrotate compress in other directory, also i try with option oldir, oldir /tmp, but dosn't work, cause the dest dir, must be in the same device, i try do a link, but, no way. Do you have any idea to use the options that you said? to compress in other directory. Thanks.
P.S.: man page is my friend, the problem is that there isn't too much documentation about logrotate, specially, how to use correctly the options that it have. for example what you can do with prerotate, postrotate, etc..
|
|
|
|
04-12-2008, 10:42 PM
|
#4
|
|
Member
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 4&5, Fedora 10, CentOS 5.4, IPCop
Posts: 569
Rep:
|
I've not done this myself, so you need to test it at your end with your op/sys. I would write a script that takes the name of the logfile as a parameter ($1), and moves the file to an alternate location where you then compress it. Then move it back to its original position in compressed state.
In your /etc/logrotate.conf file, set the compresscmd option to your script name.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:23 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|