[LON-CAPA-cvs] cvs: loncom /cron loncapa /misc cleanup_prtspool.pl doc/loncapafiles loncapafiles.lpml

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 12 May 2004 19:28:56 -0000


albertel		Wed May 12 15:28:56 2004 EDT

  Modified files:              
    /loncom/misc	cleanup_prtspool.pl 
    /doc/loncapafiles	loncapafiles.lpml 
    /loncom/cron	loncapa 
  Log:
  - renaming the cleanup_prtspool script, and reusing it to clean out the
     /home/httpd/html/userfiles directory
  
  
  
  
Index: loncom/misc/cleanup_prtspool.pl
diff -u loncom/misc/cleanup_prtspool.pl:1.2 loncom/misc/cleanup_prtspool.pl:1.3
--- loncom/misc/cleanup_prtspool.pl:1.2	Thu Nov 21 14:41:54 2002
+++ loncom/misc/cleanup_prtspool.pl	Wed May 12 15:28:55 2004
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 # The LearningOnline Network
 #
-# $Id: cleanup_prtspool.pl,v 1.2 2002/11/21 19:41:54 matthew Exp $
+# $Id: cleanup_prtspool.pl,v 1.3 2004/05/12 19:28:55 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -31,18 +31,19 @@
 
 =head1 NAME
 
-cleanup_prtspool.pl - Remove temporary files from the LON-CAPA print spool.
+cleanup_file_caches.pl - Remove temporary files from the LON-CAPA print
+spool and userfiles cache.
 
 =head1 SYNOPSIS
 
-cleanup_prtspool.pl deletes files from /home/httpd/prtspool that have not
-been accessed in 24 hours.
+cleanup_file_caches.pl deletes files from /home/httpd/prtspool ant
+/home/httpd/html/userfiles that have not been accessed in 24 hours.
 
 =head1 DESCRIPTION
 
-cleanup_prtspool.pl examines each file in /home/httpd/prtspool and checks
-its last access time.  Those files which have not been accessed in 24 hours
-are unlinked.
+cleanup_file_caches.pl examines each file in /home/httpd/prtspool and
+/home/httpd/html/userfiles and checks its last access time.  Those
+files which have not been accessed in 24 hours are unlinked.
 
 =cut
 
@@ -52,9 +53,10 @@
 use lib '/home/httpd/lib/perl/';
 use File::Find;
 use File::stat;
+use LONCAPA::Configuration;
 
-my $help = 0;
-my $killtime = time - 24 * 60 * 60;
+my $conf=LONCAPA::Configuration::read_conf('loncapa.conf');
+my $killtime = $conf->{'lonExpire'};
 
 sub kill_if_old {
     my $filename = $File::Find::name;
@@ -66,3 +68,4 @@
 }
 
 find (\&kill_if_old,'/home/httpd/prtspool');
+find (\&kill_if_old,'/home/httpd/html/userfiles');
Index: doc/loncapafiles/loncapafiles.lpml
diff -u doc/loncapafiles/loncapafiles.lpml:1.350 doc/loncapafiles/loncapafiles.lpml:1.351
--- doc/loncapafiles/loncapafiles.lpml:1.350	Mon May 10 10:17:12 2004
+++ doc/loncapafiles/loncapafiles.lpml	Wed May 12 15:28:55 2004
@@ -2,7 +2,7 @@
  "http://lpml.sourceforge.net/DTD/lpml.dtd">
 <!-- loncapafiles.lpml -->
 
-<!-- $Id: loncapafiles.lpml,v 1.350 2004/05/10 14:17:12 www Exp $ -->
+<!-- $Id: loncapafiles.lpml,v 1.351 2004/05/12 19:28:55 albertel Exp $ -->
 
 <!--
 
@@ -1421,12 +1421,12 @@
 </description>
 </file>
 <file>
-<source>loncom/misc/cleanup_prtspool.pl</source>
-<target dist='default'>home/httpd/perl/cleanup_prtspool.pl</target>
+<source>loncom/misc/cleanup_file_caches.pl</source>
+<target dist='default'>home/httpd/perl/cleanup_file_caches.pl</target>
 <categoryname>script</categoryname>
 <description>
 Batch script for removing files not accessed within 24 hours from the 
-/home/httpd/prtspool directory.
+/home/httpd/prtspool and /home/httpd/html/userfiles/ directories.
 </description>
 </file>
 <file>
Index: loncom/cron/loncapa
diff -u loncom/cron/loncapa:1.12 loncom/cron/loncapa:1.13
--- loncom/cron/loncapa:1.12	Thu Dec 11 10:46:52 2003
+++ loncom/cron/loncapa	Wed May 12 15:28:56 2004
@@ -18,8 +18,8 @@
 # Remove temporary tables from the metadata database.
 13 2 * * *    www    /home/httpd/perl/cleanup_database.pl
 
-# Clean up the printing spool.
-5 1 * * *    www    /home/httpd/perl/cleanup_prtspool.pl
+# Clean up the printing spool and userfile cache
+5 1 * * *    www    /home/httpd/perl/cleanup_file_caches.pl
 
 # Run the auto enrollment script.
 30 1 * * *    www    /home/httpd/perl/Autoenroll.pl