Skip to content
Snippets Groups Projects
Commit 54299532 authored by Andy Yates's avatar Andy Yates
Browse files

Giving this the option to specify the default location which should help when...

Giving this the option to specify the default location which should help when using these. Also switch to env perl and used warnings explicitly rather than rely on #! lines
parent 8253d5ea
No related branches found
No related tags found
No related merge requests found
#!/usr/local/ensembl/bin/perl -w
#!/usr/bin/env perl
##########################################
#
# Simple but handy script that generate the input file
......@@ -11,6 +11,7 @@
#
#########################################
use strict;
use warnings;
use DBI;
use Getopt::Long;
......@@ -22,6 +23,7 @@ my $sourcePwd="";
my $destinationHost="mart2";
my $destinationPort="3306";
my $limit='';
my $target_location = '';
my $usage = "\nUsage: $0 -sourceHost mart1 -sourceUser xxx -destinationHost mart2 -limit %42%\n
-help or -h [for help]
......@@ -31,7 +33,8 @@ my $usage = "\nUsage: $0 -sourceHost mart1 -sourceUser xxx -destinationHost mart
-sourceUser [default: ]
-destinationHost [default: mart2 ]
-destinationPort [default: 3306 ]
-limit [eg. %core_42% ]\n
-limit [eg. %core_42% ]
-target_location [default: blank if you want standard data locations]\n
The limit option will limit the databases being copied according to your limit criteria.
With -limit %core_42% only ensembl core 42 databases will be copied\n\n
......@@ -44,6 +47,7 @@ GetOptions('help|h' => \$help,
'sourcePwd=s' => \$sourcePwd,
'destinationHost=s' => \$destinationHost,
'destinationPort=s' => \$destinationPort,
'target_location=s' => \$target_location,
'limit=s' => \$limit);
if ($help || scalar @ARGV == 0 ) {
......@@ -71,7 +75,7 @@ $sth->execute( );
while ( my @row = $sth->fetchrow ){
my $result = sprintf ("%s %d %50s %s %d %s",$sourceHost.".internal.sanger.ac.uk", $sourcePort, $row[0], $destinationHost.".internal.sanger.ac.uk ", $destinationPort, $row[0]);
$result .= " $target_location" if $target_location;
print $result . "\n";
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment