--- loncom/loncron 2024/07/28 23:49:32 1.133 +++ loncom/loncron 2024/10/24 19:48:51 1.134 @@ -2,7 +2,7 @@ # Housekeeping program, started by cron, loncontrol and loncron.pl # -# $Id: loncron,v 1.133 2024/07/28 23:49:32 raeburn Exp $ +# $Id: loncron,v 1.134 2024/10/24 19:48:51 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -309,7 +309,7 @@ sub log_machine_info { sub start_logging { my $fh=IO::File->new(">$statusdir/newstatus.html"); - my %simplestatus=(); + %simplestatus=(); my $now=time; my $date=localtime($now); @@ -998,11 +998,13 @@ sub log_simplestatus { rename("$statusdir/newstatus.html","$statusdir/index.html"); my $sfh=IO::File->new(">$statusdir/loncron_simple.txt"); - foreach (keys %simplestatus) { - print $sfh $_.'='.$simplestatus{$_}.'&'; + if (defined($sfh)) { + foreach my $key (keys(%simplestatus)) { + print $sfh $key.'='.$simplestatus{$key}.'&'; + } + print $sfh "\n"; + $sfh->close(); } - print $sfh "\n"; - $sfh->close(); } sub write_loncaparevs {