From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1021 Path: news.gmane.org!not-for-mail From: Alex Efros Newsgroups: gmane.comp.sysutils.supervision.general Subject: limit svlogd log dir size Date: Mon, 13 Feb 2006 20:16:12 +0200 Organization: asdfGroup Inc., http://powerman.asdfGroup.com/ Message-ID: <20060213181612.GD6585@home.power> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1139854610 25091 80.91.229.2 (13 Feb 2006 18:16:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 13 Feb 2006 18:16:50 +0000 (UTC) Original-X-From: supervision-return-1257-gcsg-supervision=m.gmane.org@list.skarnet.org Mon Feb 13 19:16:43 2006 Return-path: Envelope-to: gcsg-supervision@gmane.org Original-Received: from antah.skarnet.org ([212.85.147.14]) by ciao.gmane.org with smtp (Exim 4.43) id 1F8iFB-0003ZV-8o for gcsg-supervision@gmane.org; Mon, 13 Feb 2006 19:16:14 +0100 Original-Received: (qmail 5265 invoked by uid 76); 13 Feb 2006 18:16:34 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 5259 invoked from network); 13 Feb 2006 18:16:34 -0000 Original-To: supervision@list.skarnet.org Mail-Followup-To: supervision@list.skarnet.org Content-Disposition: inline User-Agent: Mutt/1.5.11 Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1021 Archived-At: Hi! Is there exists way to limit size of svlogd's log directory, to guarantee it will not become too big and result in 'disk full' error? Usually svlogd rotate log files, but in some cases it will not, and amount of log files become much bigger than set in 'n' option in ./config (see example how this can happens below). I see only way to fix this issue - set special cron script which will remove unwanted log files, but that script probably will not be simple because which files are "unwanted" in each directory depends in ./config in that directory, so script should parse ./config, multiple values on "n" and "s" options (substituting default values if options not exists) to find total size allowed for '@*' + 'current' files and then remove oldest files until size of left files will be less than calculated sum. Sounds more like work for svlogd when it starting, not for cron script... powerman@home ~/tmp $ mkdir log ; echo -e "n2\ns1" >log/config powerman@home ~/tmp $ for i in $(seq 1 20); do perl -e '$|=1; print "x\n"; sleep 1; kill -9, $$' | svlogd log/; done Killed Killed Killed Killed Killed Killed Killed Killed Killed Killed Killed Killed Killed Killed Killed Killed Killed Killed Killed Killed powerman@home ~/tmp $ ls -al log/ total 91 drwxr-xr-x 2 powerman users 1080 Feb 13 20:03 . drwxr-xr-x 16 powerman users 2128 Feb 13 20:02 .. -rw-r--r-- 1 powerman users 1 Feb 13 20:02 @4000000043f0c9db047d0a4c.u -rwxr--r-- 1 powerman users 1 Feb 13 20:02 @4000000043f0c9db04c9cea4.s -rw-r--r-- 1 powerman users 1 Feb 13 20:02 @4000000043f0c9dc04f87fc4.u -rwxr--r-- 1 powerman users 1 Feb 13 20:02 @4000000043f0c9dc05450984.s -rw-r--r-- 1 powerman users 1 Feb 13 20:02 @4000000043f0c9dd0573e59c.u -rwxr--r-- 1 powerman users 1 Feb 13 20:02 @4000000043f0c9dd05c086cc.s -rw-r--r-- 1 powerman users 1 Feb 13 20:02 @4000000043f0c9de05f07c24.u -rwxr--r-- 1 powerman users 1 Feb 13 20:03 @4000000043f0c9de063d1584.s -rw-r--r-- 1 powerman users 1 Feb 13 20:03 @4000000043f0c9df06688a84.u -rwxr--r-- 1 powerman users 1 Feb 13 20:03 @4000000043f0c9df06b53b54.s -rw-r--r-- 1 powerman users 1 Feb 13 20:03 @4000000043f0c9e006e455ec.u -rwxr--r-- 1 powerman users 1 Feb 13 20:03 @4000000043f0c9e007306a7c.s -rw-r--r-- 1 powerman users 1 Feb 13 20:03 @4000000043f0c9e1075ffa44.u -rwxr--r-- 1 powerman users 1 Feb 13 20:03 @4000000043f0c9e107abdc0c.s -rw-r--r-- 1 powerman users 1 Feb 13 20:03 @4000000043f0c9e207daeed4.u -rwxr--r-- 1 powerman users 1 Feb 13 20:03 @4000000043f0c9e2082699ec.s -rw-r--r-- 1 powerman users 1 Feb 13 20:03 @4000000043f0c9e30855d3c4.u -rwxr--r-- 1 powerman users 1 Feb 13 20:03 @4000000043f0c9e308a2693c.s -rw-r--r-- 1 powerman users 1 Feb 13 20:03 @4000000043f0c9e408e9651c.u -rwxr--r-- 1 powerman users 1 Feb 13 20:03 @4000000043f0c9e4091b61fc.s -rw-r--r-- 1 powerman users 6 Feb 13 20:02 config -rw-r--r-- 1 powerman users 1 Feb 13 20:03 current -rw------- 1 powerman users 0 Feb 13 20:02 lock powerman@home ~/tmp $ cat log/config n2 s1 :-( -- WBR, Alex.