Operating System - Linux
1827283 Members
3326 Online
109717 Solutions
New Discussion

script for rotating the log files.

 
Adithyan
Frequent Advisor

script for rotating the log files.

Hi Friends,

I am going to change the Debug level of my server (Redhat AS 4.0 Up 5) to vxconfigd, I am expecting the size of the log files will be huge.

The size in the disk is not good enough.

My plan is to keep the logs for 4 days and zip it and move it to alternate location.

Could any one help me to get a script for this? So that, I can put it in the crontab.

Thanks.
Adithyan

Keen to learn HP UX
3 REPLIES 3
Alexander Chuzhoy
Honored Contributor

Re: script for rotating the log files.

I don't think you need a custom script for that.
see /etc/logrotate.conf
and also read `man logrotate`.

Court Campbell
Honored Contributor

Re: script for rotating the log files.

As noted use logrotate. Don't reinvent the wheel.

http://www.linux.com/article.pl?sid=05/09/23/1447200

"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Stuart Browne
Honored Contributor

Re: script for rotating the log files.

You friends are the keywrods 'daily' and 'compress'.

You may also want to 'postrotate' something to move log files to another location.
One long-haired git at your service...