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

Annotation of /Sprout/LoadFIGTables.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (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 Cwd;
52 :     use File::Copy;
53 :     use File::Path;
54 :     use FIG;
55 :    
56 :     # Get the command-line options and parameters.
57 :     my ($options, @parameters) = StandardSetup([qw(DBKernel DBRtns) ],
58 :     {
59 :     phone => ["", "phone number (international format) to call when load finishes"],
60 :     },
61 :     "",
62 :     @ARGV);
63 :     # Set a variable to contain return type information.
64 :     my $rtype;
65 :     # Insure we catch errors.
66 :     eval {
67 :     FIG::load_all();
68 :     };
69 :     if ($@) {
70 :     Trace("Script failed with error: $@") if T(0);
71 :     $rtype = "error";
72 :     } else {
73 :     Trace("Script complete.") if T(2);
74 :     $rtype = "no error";
75 :     }
76 :     if ($options->{phone}) {
77 :     my $msgID = Tracer::SendSMS($options->{phone}, "FIG Load terminated with $rtype.");
78 :     if ($msgID) {
79 :     Trace("Phone message sent with ID $msgID.") if T(2);
80 :     } else {
81 :     Trace("Phone message not sent.") if T(2);
82 :     }
83 :     }
84 :    
85 :    
86 :    
87 :     1;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3