[Bio] / Sprout / LoadFIGTables.pl Repository:
ViewVC logotype

Annotation of /Sprout/LoadFIGTables.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download) (as text)

1 : parrello 1.1 #!/usr/bin/perl -w
2 :    
3 :     =head1 FIG Load
4 :    
5 :     This script loads the FIG database from the SEED data store. It is similar to
6 :    
7 :     fig load_all
8 :    
9 :     from the command line, but includes phone and tracing support.
10 :    
11 :     The currently-supported command-line options are as follows.
12 :    
13 :     =over 4
14 :    
15 :     =item user
16 :    
17 :     Name suffix to be used for log files. If omitted, the PID is used.
18 :    
19 :     =item trace
20 :    
21 :     Numeric trace level. A higher trace level causes more messages to appear. The
22 :     default trace level is 2. Tracing will be directly to the standard output
23 :     as well as to a C<trace>I<User>C<.log> file in the FIG temporary directory,
24 :     where I<User> is the value of the B<user> option above.
25 :    
26 :     =item sql
27 :    
28 :     If specified, turns on tracing of SQL activity.
29 :    
30 :     =item background
31 :    
32 :     Save the standard and error output to files. The files will be created
33 :     in the FIG temporary directory and will be named C<err>I<User>C<.log> and
34 :     C<out>I<User>C<.log>, respectively, where I<User> is the value of the
35 :     B<user> option above.
36 :    
37 :     =item h
38 :    
39 :     Display this command's parameters and options.
40 :    
41 :     =item phone
42 :    
43 :     Phone number to message when the script is complete.
44 :    
45 :     =back
46 :    
47 :     =cut
48 :    
49 :     use strict;
50 :     use Tracer;
51 :     use DocUtils;
52 :     use TestUtils;
53 :     use Cwd;
54 :     use File::Copy;
55 :     use File::Path;
56 :     use FIG;
57 :    
58 :     # Get the command-line options and parameters.
59 :     my ($options, @parameters) = StandardSetup([qw(DBKernel DBRtns) ],
60 :     {
61 :     phone => ["", "phone number (international format) to call when load finishes"],
62 :     },
63 :     "",
64 :     @ARGV);
65 :     # Set a variable to contain return type information.
66 :     my $rtype;
67 :     # Insure we catch errors.
68 :     eval {
69 :     FIG::load_all();
70 :     };
71 :     if ($@) {
72 :     Trace("Script failed with error: $@") if T(0);
73 :     $rtype = "error";
74 :     } else {
75 :     Trace("Script complete.") if T(2);
76 :     $rtype = "no error";
77 :     }
78 :     if ($options->{phone}) {
79 :     my $msgID = Tracer::SendSMS($options->{phone}, "FIG Load terminated with $rtype.");
80 :     if ($msgID) {
81 :     Trace("Phone message sent with ID $msgID.") if T(2);
82 :     } else {
83 :     Trace("Phone message not sent.") if T(2);
84 :     }
85 :     }
86 :    
87 :    
88 :    
89 :     1;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3