Click to See Complete Forum and Search --> : bash script for database searching using crontab
saurya_s
01-21-2004, 10:00 AM
Hi all
I usally do database search for references everyweek at PubMed
http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed
Now, can I automate this:
#1 Can I make this to do every monday using certain defined keywords.
#And if it could mail me the results for each week.
Any geek to help me out with this? I guess it is not so difficult or am I asking too much.
SS
mrBen
01-21-2004, 10:12 AM
I had a quick look at the site, and it looks kinda tricky because of the way they have setup their variables and their 'Go' button.
You can use the wget command to get webpages 'n' stuff, but I'm not sure how you are going to be able to pass the keywords to the search.
mdwatts
01-21-2004, 10:25 AM
If you know the commands to use, put them in a executable script and schedule that through cron (/etc/crontab - system wide or /var/spool/cron - users).
saurya_s
01-21-2004, 10:42 AM
Hi all
Crontab might not be problem but to do the search thru commnad interface might be very difficult. Once I think if a way to devise search is enabled then probably I can use wget to get the result page.
Geeks and supergeeks show your savvy!!
SS
mrBen
01-21-2004, 11:39 AM
I did a quick google, and found this (http://dbforums.com/t963790.html) page - I think it may be possible to do this with Perl, as it has a plugin for interacting with webpages.
However, I don't do Perl (yet) :(
saurya_s
01-21-2004, 12:11 PM
Hi there
I have found a program which does that but it ie meant for UNIX.
http://biomail.sourceforge.net/biomail/
will it install on Linux?
I also have access to remote UNIX machine where I am user. So will I bale to install it there.
What I essentially would like to email the output of this program search to a group of people.
SS
mrBen
01-21-2004, 12:17 PM
Yes, I think it will install on Linux.
From the looks of it is a Perl script that runs from a webserver. So you could probably upload it to your remote account too.
mdwatts
01-21-2004, 12:17 PM
Originally posted by saurya_s
will it install on Linux?
Requirements
BioMail was written in Perl for Linux. It was also checked under Sun Solaris7, Irix 6.5 (on SGI), Tru64 Unix 4.OE (on Digital alpha), and should be fine for other Unix OSes. Alfonso Ali Herrera ported BioMail to MS Windows NT/2000. Starting from version 0.62 his changes will be part of the BioMail distribution.
BioMail requires a standard Perl distribution and two additional Perl modules from CPAN -- LWP::Simple and Mail::Mailer.
saurya_s
01-21-2004, 12:25 PM
Ok, my final aim is to forward a weeks search result to a group of people.
So I guess I can getaway by subscribing to their web service.
I need mail automation here. What I want- as soon as I get that email, can I make it to automatically forward to the given group of people. I can probably have a file containig their email IDs. Something like piping the result to mail app and asking it read the email IDs from the file. or perhaps there must be some better way of doing this.
SS
mdwatts
01-21-2004, 12:35 PM
Look into using 'forward'.
man forward
Which mail MTA are you using? Whichever should have documentation on configuring including forwarding.
saurya_s
01-21-2004, 12:56 PM
I am not using anything for command line mail things. I get my email by using Thunderbird but the server has mail app ie I can use mail command and input the file which i want to send. I could not find anything except the ./forward file.
SS
mdwatts
01-21-2004, 05:02 PM
Originally posted by saurya_s
I could not find anything except the ./forward file.
That would be it though I've never had the need to use forwarding.
saurya_s
01-21-2004, 05:20 PM
Well I have been using .forward for forwarding my mail to another account.
Now this boils down to very simple thing on mail automation.
Right, how can I forward a particular message to group of persons using mail.
Do I need a script to grep the title of the message (filtering kind of thing) and pipe it to mailand I ask mail to read list of email IDs from a file? I have heard mutt is very powerful MUA. Can I do this automation with that or with anything else?
Is it doable?
Should be!!
SS