--- loncom/loncron 2024/10/24 19:48:51 1.134 +++ loncom/loncron 2024/10/24 20:50:05 1.135 @@ -2,7 +2,7 @@ # Housekeeping program, started by cron, loncontrol and loncron.pl # -# $Id: loncron,v 1.134 2024/10/24 19:48:51 raeburn Exp $ +# $Id: loncron,v 1.135 2024/10/24 20:50:05 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1030,10 +1030,12 @@ sub write_loncaparevs { } } if ($output) { - if (open(my $fh,">$perlvar{'lonTabDir'}/loncaparevs.tab")) { + if (open(my $fh,'>',"$perlvar{'lonTabDir'}/loncaparevs.tab")) { print $fh $output; close($fh); &Apache::lonnet::load_loncaparevs(); + } else { + print "Could not write to $perlvar{'lonTabDir'}/loncaparevs.tab\n"; } } return; @@ -1066,10 +1068,12 @@ sub write_serverhomeIDs { } } if ($output) { - if (open(my $fh,">$perlvar{'lonTabDir'}/serverhomeIDs.tab")) { + if (open(my $fh,'>',"$perlvar{'lonTabDir'}/serverhomeIDs.tab")) { print $fh $output; close($fh); &Apache::lonnet::load_serverhomeIDs(); + } else { + print "Could not write to $perlvar{'lonTabDir'}/serverhomeIDs.tab\n"; } } return; @@ -1130,6 +1134,8 @@ sub write_hostips { } close($fh); chmod(0644,$newfile); + } else { + print "Could not write to $lontabdir/currhostips.tab\n"; } } if (keys(%prevhosts) && keys(%currhosts)) { @@ -1155,6 +1161,8 @@ sub write_hostips { } print $fh "\n*******************\n\n"; close($fh); + } else { + print "Could not write to $perlvar{'lonDaemons'}/logs/hostip.log\n"; } my $emailto = &Apache::loncommon::build_recipient_list(undef, 'hostipmail',$defdom); @@ -1258,6 +1266,8 @@ sub write_connection_config { } close($fh); print "Completed writing SSL options for lonc/lond for $count items.\n"; + } else { + print "Could not write to $perlvar{'lonTabDir'}/connectionrules.tab\n"; } } else { print "Writing of SSL options skipped - no connection rules in domain configuration.\n"; @@ -1363,6 +1373,8 @@ sub write_hosttypes { } close($fh); print "Completed writing host type data for $count hosts.\n"; + } else { + print "Could not write to $perlvar{'lonTabDir'}/hosttypes.tab\n"; } } else { print "Writing of host types skipped - no hosts found.\n"; @@ -1668,7 +1680,7 @@ sub send_mail { "Subject: ".$subj."\n". "Content-type: text/html\; charset=UTF-8\n". "MIME-Version: 1.0\n\n"; - if (open(my $fh,"<$statusdir/index.html")) { + if (open(my $fh,'<',$statusdir/index.html")) { while (<$fh>) { $loncronmail .= $_; } @@ -1784,7 +1796,7 @@ sub main () { my $now = time; my $tmpfile = $perlvar{'lonDaemons'}.'/tmp/lciptables_iphost_'. $now.$$.int(rand(10000)); - if (open(my $fh,">$tmpfile")) { + if (open(my $fh,'>',"$tmpfile")) { my %iphosts = &Apache::lonnet::get_iphost(); foreach my $key (keys(%iphosts)) { print $fh "$key\n";