diff --git a/Makefile.PL b/Makefile.PL index 4205aa5..36dcfff 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -5,7 +5,7 @@ use inc::Module::Install; # Package metadata author 'Ignacio Coterillo '; -version '0.73'; +version '0.74'; license 'GPLv3'; name 'DBOD'; @@ -53,5 +53,7 @@ install_script 'scripts/dbod-init'; install_script 'scripts/dbod-ping'; install_script 'scripts/dbod-start'; install_script 'scripts/dbod-stop'; +install_script 'scripts/dbod-upload-file'; +install_script 'scripts/dbod-destroy'; WriteAll; diff --git a/scripts/dbod-upload-file b/scripts/dbod-upload-file new file mode 100755 index 0000000..4a5bc94 --- /dev/null +++ b/scripts/dbod-upload-file @@ -0,0 +1,45 @@ +#!/usr/bin/env perl +# Copyright (C) 2015, CERN +# This software is distributed under the terms of the GNU General Public +# Licence version 3 (GPL Version 3), copied verbatim in the file "LICENSE". +# In applying this license, CERN does not waive the privileges and immunities +# granted to it by virtue of its status as Intergovernmental Organization +# or submit itself to any jurisdiction. + +package dbod_file_upload; + +use warnings; +use strict; + +use DBOD::Job; +use Data::Dumper; + +my $job = DBOD::Job->new_with_options(); + +use DBOD qw ($ERROR $OK $db_type); +use DBOD::Instance; + +sub body { + + $job->log->debug('Pinging ' . $job->entity() . '/' . + $job->metadata->{db_type}); + + my $instance = DBOD::Instance::Factory->create( + $db_type->{$job->metadata->{db_type}}, + instance => $job->entity(), + metadata => $job->metadata(), + config => $job->config()); + + if ($job->is_local()) { + $job->log->debug('Job running locally in instance host'); + $job->log->info('Updating file!'); + return $OK; + } else { + $job->log->debug('This job needs run locally'); + return $ERROR; + } + return $OK; +} + +$job->run(\&body); +