Reply to this topicStart new topicStart Poll

> Log Files, Limit # of log files
Don
Posted: Mar 13 2008, 07:19 AM
Quote Post


Newbie
*

Group: Members
Posts: 23
Member No.: 2789
Joined: 5-February 08



Hi,

Is there a way to limit the number of log files? For example limit the # of each log file (pop3, psync, etc) to 7 days.

Thanks
Don
PMEmail Poster
Top
MaartenJB
Posted: Mar 13 2008, 12:33 PM
Quote Post


Junior Member
**

Group: Members
Posts: 30
Member No.: 2280
Joined: 5-October 06



Hi Don,

This is pretty easy. Create a bash script with the following line:

CODE

find /program/xmail/logs -mtime +7 -exec rm -rf '{}' \;


and add the bash script to your /etc/crontab, example to add:

CODE

05 01 * * * root /program/xmail/bin/rm_old_log_files.sh


Ofcourse you need to ajust the path to your needs.
PMEmail Poster
Top
Don
Posted: Mar 18 2008, 05:41 AM
Quote Post


Newbie
*

Group: Members
Posts: 23
Member No.: 2789
Joined: 5-February 08



Thanks, I'll give it a try.

Don
PMEmail Poster
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
« Next Oldest | Documentation and Knowledge Base | Next Newest »

Reply to this topicStart new topicStart Poll