Intranet - keeping up-to-date automatically

I am struggling with the following:
Each page on our intranet has a line of text which reads something like
Document: H&S Policy: Author: Fred Bloggs: Dated: 13/04/1999: Expires: 13/01/2000: Notify: bloggsf@mail.address
I have used shell to trawl through all the pages and pull out this line from each one. I'm stuck now trying to use the resulting text file to email the user as the page approaches it's expiry date. Am I barking up the wrong tree ?
We run RedHat Linux 6 and Apache (if that makes any difference!)
Thanks
Lou
louobrienAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mgfranzCommented:
Well with linux and apache you are pretty much limited to using a Perl script... I suppose something like a script that runs daily, checks the system date against a date in the file, if the date matches, mail an email to the user.  Shouldn't be too hard to hack something together.

Your text file will have to be seperated line by line with some sort of delimiter, then simple CSV to each field, doc, policy, author, dated, expires, notify,||

Your script will have to parse through each date field to see if it matched the system date, (not time though).  If true, run a SMTP mailer to notify the author of the impending expiration.  

Check with www.perl.com or www.cpan.org for previously written code.

Mark
0
ozoCommented:
open PAGE,"<$page" or die "can't open $page because $!";
($d,$m,$y) = (localtime time+4*24*60*60)[3,4,5];
$approach = sprintf("%d/%02d/%02d",$y+1900,$m+1,$d);
while( <PAGE> ){
    next unless ($Document,$Author,$Dated,$Expires,$Notify) = /Document: (.*): Author: (.*): Dated: (.*): Expires: (.*): Notify: (.*)/;
    next unless $approach le join"/",reverse split"/",$Expires;
    open MAIL,"|/usr/bin/sendmail -t";
    print MAIL,<<END_HERE;
To: $Notify
Subject: $Document

$page:$_
approaches expiration date
END_HERE
    close MAIL;
}
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nettromCommented:
and then simply add File::Find to what ozo suggested to crawl through the whole directory structure.
0
louobrienAuthor Commented:
Put me on the right track - thanks ozo
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.