version 1.4, 2004/08/25 15:55:17
|
version 1.5, 2004/09/15 21:11:06
|
Line 44 use lonmysql();
|
Line 44 use lonmysql();
|
use Time::HiRes(); |
use Time::HiRes(); |
use Getopt::Long(); |
use Getopt::Long(); |
use IO::File; |
use IO::File; |
|
use File::Copy; |
# |
# |
# Determine parameters |
# Determine parameters |
my ($help,$course,$domain,$drop,$file,$time_run,$nocleanup,$log); |
my ($help,$course,$domain,$drop,$file,$time_run,$nocleanup,$log,$backup); |
&Getopt::Long::GetOptions( "course=s" => \$course, |
&Getopt::Long::GetOptions( "course=s" => \$course, |
"domain=s" => \$domain, |
"domain=s" => \$domain, |
|
"backup" => \$backup, |
"help" => \$help, |
"help" => \$help, |
"logfile=s" => \$file, |
"logfile=s" => \$file, |
"timerun" => \$time_run, |
"timerun" => \$time_run, |
Line 64 Process a lon-capa activity log into a d
|
Line 65 Process a lon-capa activity log into a d
|
Parameters: |
Parameters: |
course Required |
course Required |
domain Optional |
domain Optional |
|
backup optional if present, backup the activity log file |
|
before processing it |
drop optional if present, drop all course |
drop optional if present, drop all course |
specific activity log tables. |
specific activity log tables. |
file optional Specify the file to parse, including path |
file optional Specify the file to parse, including path |
Line 140 if (-e $newfilename) {
|
Line 143 if (-e $newfilename) {
|
if (-e $sourcefilename) { |
if (-e $sourcefilename) { |
$logthis->('renaming '.$sourcefilename.' to '.$newfilename); |
$logthis->('renaming '.$sourcefilename.' to '.$newfilename); |
rename($sourcefilename,$newfilename); |
rename($sourcefilename,$newfilename); |
|
Copy($newfilename,$newfilename.'.'.time) if ($backup); |
$logthis->("renamed $sourcefilename to $newfilename"); |
$logthis->("renamed $sourcefilename to $newfilename"); |
} else { |
} else { |
my $command = 'touch '.$newfilename; |
my $command = 'touch '.$newfilename; |