Gossamer Forum
Home : Gossamer Threads Inc. : Discussion :

stand alone scripts that use GT modules

Quote Reply
stand alone scripts that use GT modules
Hi,

What would be the best way to write code using GT modules that is not used through the web, but can be executed from the shell (or cron)?

Hope I am not too vague...

Thanks Jasper

http://www.bookings.org
Quote Reply
Re: [jaspercram] stand alone scripts that use GT modules In reply to
I think you are a bit vague.... it all depends on what you want to do.

Code:
#!/usr/bin/perl

use strict;
use lib '/path/to/gt/lib';
use GT::SQL;
use vars qw/$DB/;

init();
main();

sub init {
$DB = new GT::SQL '/path/to/database/defs';
}

sub main {
# do something useful here
}
Something like this?

Ivan
-----
Iyengar Yoga Resources / GT Plugins

Last edited by:

yogi: Nov 29, 2002, 7:11 AM
Quote Reply
Re: [yogi] stand alone scripts that use GT modules In reply to
A few booboo's in that code :)

Last edited by:

Paul: Nov 29, 2002, 7:06 AM
Quote Reply
Re: [yogi] stand alone scripts that use GT modules In reply to
Hi,

I just want to add scripts to my GT code base that can use all the functionality from the GT modules and can be executed using cron.

Your code would probably do the job.

Jasper

http://www.bookings.org