Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
ff0e462a
Commit
ff0e462a
authored
Dec 15, 2013
by
Matthieu Muffato
Browse files
The dump file can be compressed
parent
2510da12
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
modules/Bio/EnsEMBL/Hive/RunnableDB/DatabaseDumper.pm
modules/Bio/EnsEMBL/Hive/RunnableDB/DatabaseDumper.pm
+14
-2
No files found.
modules/Bio/EnsEMBL/Hive/RunnableDB/DatabaseDumper.pm
View file @
ff0e462a
...
...
@@ -28,7 +28,8 @@ The following parameters are accepted:
- exclude_list [boolean=0] : do we consider 'table_list' as a list
of tables to be excluded from the dump (instead of included)
- output_file [string] : the file to write the dump to
- output_file [string] : the file to write the dump to. If the filename
ends with ".gz", the file is compressed with "gzip" (default parameters)
- output_db [string] : URL of a database to write the dump to. In this
mode, the Runnable acts like MySQLTransfer
...
...
@@ -170,13 +171,24 @@ sub run {
return
if
(
$self
->
param
('
exclude_ehive
')
and
$self
->
param
('
exclude_list
')
and
scalar
(
@$ignores
)
==
$self
->
param
('
nb_ehive_tables
'));
# mysqldump command
my
$output
=
"";
if
(
$self
->
param
('
output_file
'))
{
if
(
lc
$self
->
param
('
output_file
')
=~
/\.gz$/
)
{
$output
=
sprintf
('
| gzip > %s
',
$self
->
param
('
output_file
'));
}
else
{
$output
=
sprintf
('
> %s
',
$self
->
param
('
output_file
'));
}
}
else
{
$output
=
sprintf
('
| mysql %s
',
$self
->
mysql_conn_from_dbc
(
$self
->
param
('
real_output_db
')));
};
my
$cmd
=
join
('
',
'
mysqldump
',
$self
->
mysql_conn_from_dbc
(
$src_dbc
),
'
--skip-lock-tables
',
@$tables
,
(
map
{
sprintf
('
--ignore-table=%s.%s
',
$src_dbc
->
dbname
,
$_
)}
@$ignores
),
$
self
->
param
('
output_file
')
?
sprintf
('
> %s
',
$self
->
param
('
output_file
'))
:
sprintf
('
| mysql %s
',
$self
->
mysql_conn_from_dbc
(
$self
->
param
('
real_output_db
'))),
$
output
);
print
"
$cmd
\n
"
if
$self
->
debug
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment