File:
[LON-CAPA] /
doc /
loncapafiles /
logcleanup.piml
Revision
1.1:
download - view:
text,
annotated -
select for diffs
Fri Jul 8 15:46:40 2005 UTC (19 years, 1 month ago) by
www
Branches:
MAIN
CVS tags:
version_2_1_1,
version_2_1_0,
version_2_0_X,
version_2_0_99_1,
version_2_0_2,
version_2_0_1,
version_2_0_0,
version_1_99_3,
version_1_99_2,
HEAD
Bug #3996: log spam removal
1: <!DOCTYPE piml PUBLIC "-//TUX/DTD piml 1.0 Final//EN"
2: "http://lpml.sourceforge.net/DTD/piml.dtd">
3: <!-- logcleanup.piml -->
4:
5: <!-- $Id: logcleanup.piml,v 1.1 2005/07/08 15:46:40 www Exp $ -->
6:
7: <!--
8:
9: This file is part of the LearningOnline Network with CAPA (LON-CAPA).
10:
11: LON-CAPA is free software; you can redistribute it and/or modify
12: it under the terms of the GNU General Public License as published by
13: the Free Software Foundation; either version 2 of the License, or
14: (at your option) any later version.
15:
16: LON-CAPA is distributed in the hope that it will be useful,
17: but WITHOUT ANY WARRANTY; without even the implied warranty of
18: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19: GNU General Public License for more details.
20:
21: You should have received a copy of the GNU General Public License
22: along with LON-CAPA; if not, write to the Free Software
23: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24:
25: /home/httpd/html/adm/gpl.txt
26:
27: http://www.lon-capa.org/
28:
29: -->
30:
31: <piml>
32: <targetroot>/</targetroot>
33: <files>
34: <file>
35: <target dist='default'>/home/httpd/perl/logs/lonnet.perm.log</target>
36: <perlscript mode='fg'>
37: unless
38: (-e '<TARGET />') # Does file exist?
39: {
40: print("**** ERROR **** Missing <TARGET />\n");
41: } else {
42: system('cp <TARGET /> <TARGET />.old');
43: open(IN,'<TARGET />.old');
44: open(OUT,'><TARGET />');
45: while ($line=<IN>) {
46: unless ($line=~/signalled to death/) {
47: print OUT $line;
48: }
49: }
50: close(IN);
51: close(OUT);
52: system('chown www:www <TARGET />');
53: system('rm <TARGET />.old');
54: }
55: </perlscript>
56: </file>
57: </files>
58: </piml>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>