30,40d29
< # HC1.5 saw 05/07/1999 Add a Y2K hack in the reverse sorting of directory names. Put years 9x to
< # the end of the sort. Will work till 2090.
< # HC1.6 saw 14.05.1999 During transfer from temp to finaly directory,
< #
fields are added.
< # HC1.64 saw 09.07.1999 Update Acclerator logbook URL's
< # HC1.65 saw 06.10.1999 Require filenames to start with YYMM.
< # HC1.70 saw 04.01.2000 Truncate year returned by localtime to 2 digits
< # so that last 7 day thing works.
< # HC1.71 saw 05.01.2000 Make run start stuff optional
< # HA1.2 rwm 06.01.2000 Copy form Steve's HC1.71, trivial mods
< # to make hall C -> A.
43c32
< $SCRIPT_VERSION="HA1.2";
---
> $SCRIPT_VERSION="HA1.1";
50a40
>
59,71c49,50
< $logbook_account = "adaq"; # The account under which the logbook runs
< $server = "www.cebaf.gov"; # The server on which the log book is accessed
< #
< # This is the stuff most likely to change for new log books
< #
< $logbook_dirname = "halog"; # Logbook name (for constructing directories)
< $logbook = "HALOG";
< $LOGTITLE = "Hall A";
< $do_runstart_stuff = "1"; # Do the Run Start stuff
< $extraheader_html = qq{};
< #
< # End of custom stuff
< #
---
> $webmgr = "/net/fs7/home/adaq/public_html/halog";
> $httptj = "A HREF=http://www.cebaf.gov/~adaq/halog";
73,74c52,55
< $webmgr = "/home/$logbook_account/$logbook_dirname";
< $httptj = "A HREF=http://$server/~$logbook_account/$logbook_dirname";
---
> #$auto_regexp = "^Run \\d+:"; # Regular expression to find automatic entries
> $auto_regexp = "End_of_Run"; # Regular expression to find end of run entries
> $auto_regexp2 = "Accounting"; # Regular expression to find accounting entries
> $auto_regexp3 = "Start_Run"; # Regular expression to find accounting entries
76,77d56
< $auto_regexp = "^Run \\d+:"; # Regular expression to find automatic entries
<
117,124c96,105
< # close(STDERR);
< # open( STDERR, "/usr/csite5/web/html/internal/halla/halog/dolog.log");
< # $tmpdir = "$webmgr/html/internal/halla/halog/tmp_html/";
< # $htmldir = "$webmgr/html/internal/halla/halog/html/";
< # $logfile = "$webmgr/html/internal/halla/halog/dolog.perl.log";
< # $refdir = "halla/halog";
< # $scrollname = "halog_selection";
< # $LOGTITLE = "HALL A";
---
> $logbook = "HALOG";
> close(STDERR);
> open( STDERR, "/net/fs7/home/adaq/halog/log/dolog.log");
> $tmpdir = "$webmgr/log/tmp_html/";
> $htmldir = "$webmgr/log/html/";
> $logfile = "$webmgr/log/dolog.perl.log";
> $refdir = "log";
> $scrollname = "halog_selection";
> $LOGTITLE = "HALL A";
>
139,146c120,129
< close(STDERR);
< open( STDERR, "/home/$logbook_account/$logbook_dirname/log/dolog.log");
< $tmpdir = "$webmgr/log/tmp_html/";
< $htmldir = "$webmgr/log/html/";
< $logfile = "$webmgr/log/dolog.perl.log";
< $refdir = "log";
< $scrollname = "$logbook_dirname_selection";
<
---
> #$logbook = "HCLOG";
> # close(STDERR);
> # open( STDERR, "/net/fs7/home/cdaq/hclog/log/dolog.log");
> # $tmpdir = "$webmgr/log/tmp_html/";
> # $htmldir = "$webmgr/log/html/";
> # $logfile = "$webmgr/log/dolog.perl.log";
> # $refdir = "log";
> # $scrollname = "hclog_selection";
> # $LOGTITLE = "HALL C";
> #
287,291c270
< #Begin Y2K Fix
< @html_dirs_the1990s=reverse sort grep( /9..._archive$/, @html_array );
< @html_dirs_newmillenium=reverse sort grep( /[0-8]..._archive$/, @html_array );
< @html_dirs = (@html_dirs_newmillenium,@html_dirs_the1990s);
< #End Y2K Fix
---
> @html_dirs=reverse sort grep( /...._archive$/, @html_array );
294d272
< #$html_archive = "9908_archive"; # Hack to fix Aug 1999.
324c302,305
< &print_logdirhead(OUTFILE,"full listing");
---
> open( OUTFILE_AUTO, ">logdir_auto.new.html" );
> open( OUTFILE_AUTO2, ">logdir_auto2.new.html" );
> open( OUTFILE_NOAUTO, ">logdir_noauto.new.html" );
> open( OUTFILE_NOAUTO2, ">logdir_noauto2.new.html" );
326,331c307,311
< if($do_runstart_stuff) {
< open( OUTFILE_AUTO, ">logdir_auto.new.html" );
< open( OUTFILE_NOAUTO, ">logdir_noauto.new.html" );
< &print_logdirhead(OUTFILE_AUTO,"runstarts only");
< &print_logdirhead(OUTFILE_NOAUTO,"runstarts omitted");
< }
---
> &print_logdirhead(OUTFILE,"Full Listing");
> &print_logdirhead(OUTFILE_AUTO,"Run Ends Only");
> &print_logdirhead(OUTFILE_AUTO2,"Run Starts Only");
> &print_logdirhead(OUTFILE_NOAUTO,"Accounting Only");
> &print_logdirhead(OUTFILE_NOAUTO2,"All EXCEPT Automatic Entries");
350,352d329
< # Local time returns (year-1900). Just keep the last tow digits since we only
< # use two digits of year in filenames. Fix this log book before 2090.
< $year %= 100;
374c351
< @html_array=grep( /^$html_wildcard/, @html_array );
---
> @html_array=grep( /$html_wildcard/, @html_array );
451,454c428,431
< if($do_runstart_stuff) {
< printf( OUTFILE_AUTO "\n" );
< printf( OUTFILE_NOAUTO "\n" );
< }
---
> printf( OUTFILE_AUTO "\n" );
> printf( OUTFILE_AUTO2 "\n" );
> printf( OUTFILE_NOAUTO "\n" );
> printf( OUTFILE_NOAUTO2 "\n" );
458,461c435,438
< if($do_runstart_stuff) {
< print OUTFILE_AUTO $dayheader;
< print OUTFILE_NOAUTO $dayheader;
< }
---
> print OUTFILE_AUTO $dayheader;
> print OUTFILE_AUTO2 $dayheader;
> print OUTFILE_NOAUTO $dayheader;
> print OUTFILE_NOAUTO2 $dayheader;
471,472c448
< if($do_runstart_stuff) {
< if($KEYWORD=~/$auto_regexp/o) {
---
> if($KEYWORD=~/$auto_regexp/o) {
474c450
< } else {
---
> } elsif($KEYWORD=~/$auto_regexp2/o) {
476c452,455
< }
---
> } elsif($KEYWORD=~/$auto_regexp3/o) {
> print OUTFILE_AUTO2 $entry_line;
> } else {
> print OUTFILE_NOAUTO2 $entry_line;
492,493c471
< if($do_runstart_stuff) {
< if($KEYWORD=~/$auto_regexp/o) {
---
> if($KEYWORD=~/$auto_regexp/o) {
495c473
< } else {
---
> } elsif ($KEYWORD=~/$auto_regexp2/o) {
497c475,478
< }
---
> } elsif($KEYWORD=~/$auto_regexp3/o) {
> print(OUTFILE_AUTO2 "$followuplist");
> } else {
> print(OUTFILE_NOAUTO2 "$followuplist");
502,503c483
< if($do_runstart_stuff) {
< if($KEYWORD=~/$auto_regexp/o) {
---
> if($KEYWORD=~/$auto_regexp/o) {
505c485
< } else {
---
> } elsif($KEYWORD=~/$auto_regexp2/o) {
507c487,490
< }
---
> } elsif($KEYWORD=~/$auto_regexp3/o) {
> print(OUTFILE_AUTO2 "$followuplist");
> } else {
> print(OUTFILE_NOAUTO2 "$followuplist");
531,535c514
< #Begin Y2K Fix
< @html_dirs_the1990s=reverse sort grep( /9..._archive$/, @html_array );
< @html_dirs_newmillenium=reverse sort grep( /[0-8]..._archive$/, @html_array );
< @html_dirs = (@html_dirs_newmillenium,@html_dirs_the1990s);
< #End Y2K Fix
---
> @html_dirs=grep( /...._archive$/, @html_array );
536a516,520
> print OUTFILE_AUTO "
\n";
> print OUTFILE_NOAUTO "
\n";
> print OUTFILE_AUTO2 "
\n";
> print OUTFILE_NOAUTO2 "
\n";
>
537a522,525
> print OUTFILE_AUTO "\n";
> print OUTFILE_NOAUTO "\n";
> print OUTFILE_AUTO2 "\n";
> print OUTFILE_NOAUTO2 "\n";
539,545d526
< if($do_runstart_stuff) {
< print OUTFILE_AUTO "
\n";
< print OUTFILE_NOAUTO "
\n";
< print OUTFILE_AUTO "\n";
< print OUTFILE_NOAUTO "\n";
< }
<
549c530,533
< $entry_line = sprintf(qq{%s %s Archive\n | \n},
---
> $entry_line = sprintf(qq{
%s %s Archive\n | \n
> Beam Accounting Only | End of Run Only |
\n
> All EXCEPT Automatic Entries | Start Run Only | \n
> Search Entries | \n},
553,562d536
< if($do_runstart_stuff) {
< $entry_line .= qq{
<
< No runs
< |
< Run Starts
< | \n};
< } else {
< $entry_line .= "\n";
< }
564,567c538,541
< if($do_runstart_stuff) {
< print OUTFILE_NOAUTO $entry_line;
< print OUTFILE_AUTO $entry_line;
< }
---
> print OUTFILE_NOAUTO $entry_line;
> print OUTFILE_AUTO $entry_line;
> print OUTFILE_NOAUTO2 $entry_line;
> print OUTFILE_AUTO2 $entry_line;
584,587c558,561
< if($do_runstart_stuff) {
< print OUTFILE_AUTO "
\n";
< print OUTFILE_NOAUTO "
\n";
< }
---
> print OUTFILE_AUTO "
\n";
> print OUTFILE_NOAUTO "
\n";
> print OUTFILE_AUTO2 "
\n";
> print OUTFILE_NOAUTO2 "
\n";
651a626,630
> &print_logdirtail(OUTFILE_AUTO);
> &print_logdirtail(OUTFILE_NOAUTO);
> &print_logdirtail(OUTFILE_AUTO2);
> &print_logdirtail(OUTFILE_NOAUTO2);
>
652a632,635
> close( OUTFILE_AUTO );
> close( OUTFILE_NOAUTO );
> close( OUTFILE_AUTO2 );
> close( OUTFILE_NOAUTO2 );
654,660d636
< if($do_runstart_stuff) {
< &print_logdirtail(OUTFILE_AUTO);
< &print_logdirtail(OUTFILE_NOAUTO);
< close( OUTFILE_AUTO );
< close( OUTFILE_NOAUTO );
< }
<
668,673c644,651
< if($do_runstart_stuff) {
< unlink( "logdir_auto.html" );
< rename( "logdir_auto.new.html", "logdir_auto.html" );
< unlink( "logdir_noauto.html" );
< rename( "logdir_noauto.new.html", "logdir_noauto.html" );
< }
---
> unlink( "logdir_auto.html" );
> rename( "logdir_auto.new.html", "logdir_auto.html" );
> unlink( "logdir_noauto.html" );
> rename( "logdir_noauto.new.html", "logdir_noauto.html" );
> unlink( "logdir_auto2.html" );
> rename( "logdir_auto2.new.html", "logdir_auto2.html" );
> unlink( "logdir_noauto2.html" );
> rename( "logdir_noauto2.new.html", "logdir_noauto2.html" );
675c653
< system( "/bin/chown $logbook_account $logdir.html" );
---
> system( "/bin/chown cdaq $logdir.html" );
719a698,699
> unlink( "logdir_auto.new.html" );
> unlink( "logdir_noauto.new.html" );
721,729c701,704
< &print_logdirmonthhead(OUTFILE,"full listing");
< if($do_runstart_stuff) {
< unlink( "logdir_auto.new.html" );
< unlink( "logdir_noauto.new.html" );
< open( OUTFILE_AUTO, ">logdir_auto.new.html" );
< open( OUTFILE_NOAUTO, ">logdir_noauto.new.html" );
< &print_logdirmonthhead(OUTFILE_AUTO,"runstarts only");
< &print_logdirmonthhead(OUTFILE_NOAUTO,"runstarts omitted");
< }
---
> open( OUTFILE_AUTO, ">logdir_auto.new.html" );
> open( OUTFILE_NOAUTO, ">logdir_noauto.new.html" );
> open( OUTFILE_AUTO2, ">logdir_auto2.new.html" );
> open( OUTFILE_NOAUTO2, ">logdir_noauto2.new.html" );
730a706,711
> &print_logdirmonthhead(OUTFILE,"Full Listing");
> &print_logdirmonthhead(OUTFILE_AUTO,"Run Ends Only");
> &print_logdirmonthhead(OUTFILE_AUTO2,"Run Starts Only");
> &print_logdirmonthhead(OUTFILE_NOAUTO,"Accounting Only");
> &print_logdirmonthhead(OUTFILE_NOAUTO2,"All EXCEPT Automatic Entries");
>
757d737
< # print "Working on $html_filename\n";
823c803
< system( "/bin/chown $logbook_account $html_filename*" );
---
> system( "/bin/chown cdaq $html_filename*" );
860,864c840,844
< if($do_runstart_stuff) {
< printf( OUTFILE_AUTO "\n" );
< printf( OUTFILE_NOAUTO "\n" );
< }
< }
---
> printf( OUTFILE_AUTO "\n" );
> printf( OUTFILE_NOAUTO "\n" );
> printf( OUTFILE_AUTO2 "\n" );
> printf( OUTFILE_NOAUTO2 "\n" );
> }
867,870c847,850
< if($do_runstart_stuff) {
< print OUTFILE_AUTO $dayheader;
< print OUTFILE_NOAUTO $dayheader;
< }
---
> print OUTFILE_AUTO $dayheader;
> print OUTFILE_NOAUTO $dayheader;
> print OUTFILE_AUTO2 $dayheader;
> print OUTFILE_NOAUTO2 $dayheader;
915,921c895,903
< if($do_runstart_stuff) {
< if($KEYWORD=~/$auto_regexp/o) {
< print OUTFILE_AUTO $entry_line;
< } else {
< print OUTFILE_NOAUTO $entry_line;
< }
< }
---
> if($KEYWORD=~/$auto_regexp/o) {
> print OUTFILE_AUTO $entry_line;
> } elsif($KEYWORD=~/$auto_regexp2/o) {
> print OUTFILE_NOAUTO $entry_line;
> } elsif($KEYWORD=~/$auto_regexp3/o) {
> print OUTFILE_AUTO2 $entry_line;
> } else {
> print OUTFILE_NOAUTO2 $entry_line;
> }
927,928c909
< if($do_runstart_stuff) {
< if($KEYWORD=~/$auto_regexp/o) {
---
> if($KEYWORD=~/$auto_regexp/o) {
930c911
< } else {
---
> } elsif($KEYWORD=~/$auto_regexp2/o) {
932c913,916
< }
---
> } elsif($KEYWORD=~/$auto_regexp3/o) {
> print(OUTFILE_AUTO2 "$followuplist");
> } else {
> print(OUTFILE_NOAUTO2 "$followuplist");
943a928,935
> unlink( "logdir_auto.html" );
> rename( "logdir_auto.new.html", "logdir_auto.html" );
> unlink( "logdir_noauto.html" );
> rename( "logdir_noauto.new.html", "logdir_noauto.html" );
> unlink( "logdir_auto2.html" );
> rename( "logdir_auto2.new.html", "logdir_auto2.html" );
> unlink( "logdir_noauto2.html" );
> rename( "logdir_noauto2.new.html", "logdir_noauto2.html" );
945c937
< system( "/bin/chown $logbook_account $logdir.html" );
---
> system( "/bin/chown cdaq $logdir.html" );
946a939,943
> printf( OUTFILE_AUTO "\n" );
> printf( OUTFILE_NOAUTO "\n" );
> printf( OUTFILE_AUTO2 "\n" );
> printf( OUTFILE_NOAUTO2 "\n" );
>
948d944
< close( OUTFILE );
950,959c946,950
< if($do_runstart_stuff) {
< unlink( "logdir_auto.html" );
< rename( "logdir_auto.new.html", "logdir_auto.html" );
< unlink( "logdir_noauto.html" );
< rename( "logdir_noauto.new.html", "logdir_noauto.html" );
< printf( OUTFILE_AUTO "\n" );
< printf( OUTFILE_NOAUTO "\n" );
< close( OUTFILE_AUTO );
< close( OUTFILE_NOAUTO );
< }
---
> close( OUTFILE );
> close( OUTFILE_AUTO );
> close( OUTFILE_NOAUTO );
> close( OUTFILE_AUTO2 );
> close( OUTFILE_NOAUTO2 );
1020,1028c1011
< #Don't Move it here, rewrite it
< # system( "/bin/mv $tmpdir$root_filename.html $htmldir$archiveDir" );
< open(OUT,">$htmldir$archiveDir$root_filename.html");
< print OUT "$KEYWORD\n";
< close(OUT);
< system( "/bin/cat $tmpdir$root_filename.html >> $htmldir$archiveDir$root_filename.html" );
< open(OUT,">>$htmldir$archiveDir$root_filename.html");
< print OUT "\n";
< unlink "$tmpdir$root_filename.html";
---
> system( "/bin/mv $tmpdir$root_filename.html $htmldir$archiveDir" );
1032c1015
< system( "/bin/chown $logbook_account $htmldir$archiveDir/$root_filename*" );
---
> system( "/bin/chown cdaq $htmldir$archiveDir/$root_filename*" );
1072,1074c1055,1056
<
< $logbook_dirname FAQ's+HOWTO \n";
< print $fh "$extraheader_html";
---
>
> halog FAQ's+HOWTO \n";
1080,1083c1062,1064
< print $fh qq{Scrollable logbook | \n};
< if($do_runstart_stuff) {
< print $fh qq{All except run starts | \n};
< }
---
> print $fh qq{Scrollable logbook | \n};
> print $fh qq{Beam Accounting Only | \n};
> print $fh qq{All EXCEPT Automatic Entries | \n};
1087,1089c1068,1070
< if($do_runstart_stuff) {
< print $fh qq{Run starts only | \n};
< }
---
> print $fh qq{Run Ends Only | \n};
> print $fh qq{Run Starts Only | \n};
> print $fh qq{Search Entries | \n};
1141,1150d1121
< print $fh qq{
<
< };
< print $fh "
\n";
1156,1161c1127,1129
< # print $fh "Jochen Volmer
\n";
< # print $fh "volmer\@cebaf.gov
\n";
< # print $fh "(757) 269-5195\n";
< print $fh "Stephen A. Wood
\n";
< print $fh "saw\@jlab.org
\n";
< print $fh "(757) 269-7367
\n";
---
> print $fh "Jochen Volmer
\n";
> print $fh "volmer\@cebaf.gov
\n";
> print $fh "(757) 269-5011
\n";
1163a1132,1135
>
>
>
>