Annotation of doc/loncapafiles/logcleanup.piml, revision 1.2
1.1 www 1: <!DOCTYPE piml PUBLIC "-//TUX/DTD piml 1.0 Final//EN"
2: "http://lpml.sourceforge.net/DTD/piml.dtd">
3: <!-- logcleanup.piml -->
4:
1.2 ! raeburn 5: <!-- $Id: logcleanup.piml,v 1.1 2005/07/08 15:46:40 www Exp $ -->
1.1 www 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'>
1.2 ! raeburn 37: if (-e '<TARGET />') # Does file exist?
1.1 www 38: {
39: system('cp <TARGET /> <TARGET />.old');
40: open(IN,'<TARGET />.old');
41: open(OUT,'><TARGET />');
42: while ($line=<IN>) {
43: unless ($line=~/signalled to death/) {
44: print OUT $line;
45: }
46: }
47: close(IN);
48: close(OUT);
49: system('chown www:www <TARGET />');
50: system('rm <TARGET />.old');
51: }
52: </perlscript>
53: </file>
54: </files>
55: </piml>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>