7 # this script will remove those older than 5 days
10 opendir( my $dh, $tmpdir) || die "Cannot open $tmpdir : $!";
12 my @files_in_tmp = grep { /\.CE[IQ]$/ && -f
"$tmpdir/$_" } readdir($dh);
16 my $dbh = C4
::Context
->dbh;
18 my $query =<<'ENDSQL';
19 select filename from edifact_messages
20 where message_type IN ('QUOTE','INVOICE')
21 and datediff( CURDATE(), transfer_date ) > 5
26 @
{$ingested} = $dbh->selectcol_arrayref($query);
28 my %ingested_hash = map { $_ => 1 } @
{$ingested};
32 foreach (@files_in_tmp) {
33 if ( exists $ingested_hash{$_} ) {
34 push @delete_list, $_;