hallikpapa has asked for the wisdom of the Perl Monks concerning the following question:
Something I was thinking about though was the fact sometimes it may not hit right on the HH:MM:00 and not cut the files appropriately. Thanks for any suggestions!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 ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Splitting up a file in hourly increments
by tuxz0r (Pilgrim) on Dec 12, 2007 at 20:20 UTC | |
by hallikpapa (Scribe) on Dec 12, 2007 at 20:34 UTC | |
|
Re: Splitting up a file in hourly increments
by pc88mxer (Vicar) on Dec 12, 2007 at 20:52 UTC | |
|
Re: Splitting up a file in hourly increments
by andreas1234567 (Vicar) on Dec 13, 2007 at 09:16 UTC |