in reply to Hitting a moving target (transient files)
#!/usr/bin/perl -w chdir "<directory>"; my @excludelist; my $excludefile = "<directory>/exclude"; my $count; while (1) { if ( -s $excludefile ) { open (EXCLUDE,"$excludefile"); @excludelist = <EXCLUDE>; close (EXCLUDE); } undef $/; @ARGV = <di*>; while (<>) { next if (grep /\b$ARGV\b/ , @excludelist); $count = s/\0{30}\t\0\0\(\0//g; rename $ARGV,"../capture/nested/$ARGV" if ($count >= 10); } $/ = "\n"; @excludelist = (); sleep 3; }
This screamed through a large list.
I also wanted to address the numerous people who suggested that there should be a better way to do this other than trying to move files on a live queue. I agree that if there was a way to get my propietary MTA to recognize this pattern and take a different action on them before writing them out it would be the best solution - but alas there is not.
This particular directory is where the messages sit once my MTA has completely processed them. What you say, your MTA is finished with them but doesn't send them along to the next MTA?
No, this particular propietary mail system waits for the distant end to establish an FTP session and download these mail messages.
Yes - mail being pulled via FTP
No - no better way to do it
Thanks again,
L~R
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re2: Hitting a moving target (transient files)
by tye (Sage) on Dec 18, 2002 at 23:17 UTC |