4 # Run by cron at 7:50 to archive (in web space) the current blitz mpeg
5 # and to generate a new html index file. Outputs html.
6 # -Drake (dld@chem.psu.edu)
10 chdir '/home/children/html/howitzer';
12 @file = ("Blitz-0", "Blitz-1","Blitz-2","Blitz-3","Blitz-4", "Blitz-5","Blitz-6", "Blitz-7");
13 unlink("$file[$#file].mpg","$file[$#file].gif","$file[$#file].txt","$file[$#file]Ann.txt");
16 for ($i=$#file;$i>0;$i--) {
17 rename($file[$i-1] . '.mpg',"$file[$i].mpg");
18 rename($file[$i-1] . '.gif',"$file[$i].gif");
19 rename($file[$i-1] . '.txt',"$file[$i].txt");
20 rename($file[$i-1] . 'Ann.txt',"$file[$i]Ann.txt");
23 if (-s 'Blitz.mpg') { system('cp -p Blitz.mpg Blitz-0.mpg'); }
24 if (-s 'Blitz.gif') { system('cp -p Blitz.gif Blitz-0.gif'); }
25 if (-s 'Blitz.txt') { system('cp -p Blitz.txt Blitz-0.txt'); }
26 if (-s 'Blitz.txt') { system('cp -p BlitzAnn.txt Blitz-0Ann.txt'); }
28 print "<html> <head>\n";
29 print "<title>Howitzer Blitz Archive</title>\n";
30 print "</head>\n<body>\n";
31 print "<h1>Archived Blitzes</h1>\n";
34 foreach $base (@file) {
35 $file = $base . '.mpg';
38 ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
39 $atime,$mtime,$ctime,$blksize,$blocks)
41 chop($m=&ctime($mtime));
42 print "<li> $m <ul>\n";
43 print "<li> <a href=\"$file\"> <img alt=\"MPEG\" src=\"$base.gif\"><br>($size bytes)</a>\n";
44 print "<li> <a href=\"$base.gif\">Final Map</a>\n";
45 print "<li> <a href=\"$base.txt\">Reports</a>\n\n";
46 print "<li> <a href=\"$base" . "Ann.txt\">Announcements</a>\n</ul>\n";
51 print "</body> </html>\n";