if ($connected) { $timestamp = time; if ( $timestamp < $midnight ) { log_notice("Client : Restarting $0\n"); log_error("End Processing $src_cdr_file\n"); exec '/home/$0' || log_warn("Client : Could not exec $0\n"); exit 6; # Something is wrong if this exit is taken } # End if $timestamp log_notice("Client : Normal Termination\n"); log_error("End Processing $src_cdr_file\n\n"); exec '/usr/bin/perl', '/home/$0' || log_warn("Client : Could not exec $0\n"); exit 7; # Something is wrong if this exit is taken } # End if $connected }; # End anonymous sub print $socket "tail\n"; # Rock n Roll open( STDOUT, "> /dev/null" ); # Begin processing records while ( defined( my $line = <$socket> ) ) { if ($recover_mode) { $rec_num++; } db_record( $sth, $line, $recover_from ); }