[Bio] / FortyEight / dump-rast-data.pl Repository:
ViewVC logotype

View of /FortyEight/dump-rast-data.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Wed Jun 8 20:58:35 2011 UTC (8 years, 5 months ago) by olson
Branch: MAIN
CVS Tags: mgrast_dev_08112011, mgrast_dev_08022011, rast_rel_2014_0912, rast_rel_2014_0729, mgrast_release_3_1_2, mgrast_release_3_1_1, rast_rel_2011_0928, mgrast_version_3_2, mgrast_dev_12152011, mgrast_dev_10262011, HEAD
Spreadsheet export, new script for dumping queue data.

use strict;
use DBMaster;
use FIG_Config;
use Data::Dumper;
use FIG;

my $user;
my $job;
my $stages;
my $sge_status;
my $running_only;

my      $dbmaster = DBMaster->new(-database => $FIG_Config::webapplication_db || "WebAppBackend",
				-host     => $FIG_Config::webapplication_host || "localhost",
				-user     => $FIG_Config::webapplication_user || "root",
				-password => $FIG_Config::webapplication_password || "");

my $user_obj;

if ($user)
{
    $user_obj = $dbmaster->User->init({ login => $user });
}

my $d = DBMaster->new(-database => $FIG_Config::rast_jobcache_db,
		      -backend => 'MySQL',
		      -host => $FIG_Config::rast_jobcache_host,
		      -user => $FIG_Config::rast_jobcache_user);

my $job_spec = {};

my $all = $d->Job->get_objects($job_spec);

for my $j (sort { $b->id <=> $a->id } @$all)
{
    my $n = $j->genome_name;
    my $gid = $j->genome_id;
    my $id = $j->id;
    my $dir = $j->dir;
    my $created = $j->created_on();

    my $user = $j->owner->login;

    my $final = $d->Status->get_objects({ job => $j, stage => "status.final" });
    print join("\t", $id, $created, $gid, $n, $user, $dir, (ref($final->[0]) ? $final->[0]->status : 'incomplete')), "\n";
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3