Graham Foster wrote: >I need to write a SQL report agent. Very simple. > >-) Run various administrative SQL queries against different >databases > >-) Run as a scheduled job, (under Windows AT command I guess) so they >will be automatically refreshed every 8 hours / day / week (or >whatever frequency it needs doing) > >- Output would be a textual "report" from the SELECT recordset dump, >do a defined filepath > > You could look at some of the SQL projects at: http://raa.ruby-lang.org/ http://www.ruby-forge.org >and/or > >- e-mail (to me) saying all is still well (or not) optionally >including the report > > This is very simple with the Net::SMTP library. It is apart of the standard library. The API documentation can be found at: http://www.ruby-doc.org/stdlib/libdoc/net/smtp/rdoc/ If you don't want to read docs and want to read some code, I can send you a email script i wrote a while back. It even has a command line interface to it as well. It may work unmodified for you. >I need to be able to add new scripts easily, and I can have a >dedicated machine running it if necessary (although I'd like a >service.. if this is possible?) > > How you want top add scripts to the mix could be extremely easy. It would moreover depend on what type of structure you are going to give your program. One way might be to create a class then runs the scripts. Put the name of each script in a config file, have the main class read it in. It could then just loop through the scripts. Any time you add a new script, just add it to the config file. You can define a service by using srvany.exe. Check it out at: http://support.microsoft.com/kb/q137890/ >I was about to reach for Perl (as I've done something similar there >before), but I think I'd like to try Ruby, anyone give me a start >here? > > I think you'll find this task is easier then you think! Probably way easier then in Perl! Zach