From bdfcf0e69f28bbe8e4092c3b7193ea42115c5055 Mon Sep 17 00:00:00 2001 From: ribes Date: Thu, 12 Nov 2009 13:34:49 +0000 Subject: [PATCH] - Use exportInputFiles in eSSH - Add option "-r" by default on copy --- src/Core/Batch_CommunicationProtocolRSH.cxx | 1 + src/Core/Batch_CommunicationProtocolSH.cxx | 1 + src/Core/Batch_CommunicationProtocolSSH.cxx | 1 + src/SSH/Batch_BatchManager_eSSH.cxx | 33 +++------------------ 4 files changed, 7 insertions(+), 29 deletions(-) diff --git a/src/Core/Batch_CommunicationProtocolRSH.cxx b/src/Core/Batch_CommunicationProtocolRSH.cxx index 5fabe63..e2927f4 100644 --- a/src/Core/Batch_CommunicationProtocolRSH.cxx +++ b/src/Core/Batch_CommunicationProtocolRSH.cxx @@ -102,6 +102,7 @@ namespace Batch { fullDestination += destinationPath; cmd.push_back(RCP_COMMAND); + cmd.push_back("-r"); cmd.push_back(fullSource); cmd.push_back(fullDestination); diff --git a/src/Core/Batch_CommunicationProtocolSH.cxx b/src/Core/Batch_CommunicationProtocolSH.cxx index 2c5bfd0..b5193d6 100644 --- a/src/Core/Batch_CommunicationProtocolSH.cxx +++ b/src/Core/Batch_CommunicationProtocolSH.cxx @@ -75,6 +75,7 @@ namespace Batch { { vector cmd; cmd.push_back(CP_COMMAND); + cmd.push_back("-r"); cmd.push_back(fixPath(sourcePath)); cmd.push_back(fixPath(destinationPath)); return cmd; diff --git a/src/Core/Batch_CommunicationProtocolSSH.cxx b/src/Core/Batch_CommunicationProtocolSSH.cxx index a9c6590..428bfc9 100644 --- a/src/Core/Batch_CommunicationProtocolSSH.cxx +++ b/src/Core/Batch_CommunicationProtocolSSH.cxx @@ -84,6 +84,7 @@ namespace Batch { // (particularly useful to keep scripts executable when copying them) cmd.push_back(SCP_COMMAND); cmd.push_back("-p"); + cmd.push_back("-r"); cmd.push_back(fullSource); cmd.push_back(fullDestination); diff --git a/src/SSH/Batch_BatchManager_eSSH.cxx b/src/SSH/Batch_BatchManager_eSSH.cxx index 3e085d4..30428b2 100644 --- a/src/SSH/Batch_BatchManager_eSSH.cxx +++ b/src/SSH/Batch_BatchManager_eSSH.cxx @@ -70,37 +70,12 @@ namespace Batch { std::cerr << "BatchManager_eSSH::submitJob exportInputFiles" << std::endl; Parametre param = job.getParametre(); - // Creates job repertories - if (string(param[TMPDIR]) != "") - { - string subCommand = string("mkdir -p ") + string(param[TMPDIR]); - string command = BatchManager_eClient::_protocol.getExecCommand(subCommand, _hostname, _username); - cerr << command.c_str() << endl; - int status = system(command.c_str()); - if(status) { - std::ostringstream oss; - oss << status; - std::string ex_mess("Error of connection on remote host ! status = "); - ex_mess += oss.str(); - throw EmulationException(ex_mess.c_str()); - } - } - if (string(param[TMPDIR]) != "") - { - string subCommand = string("mkdir -p ") + string(param[WORKDIR]); - string command = BatchManager_eClient::_protocol.getExecCommand(subCommand, _hostname, _username); - cerr << command.c_str() << endl; - int status = system(command.c_str()); - if(status) { - std::ostringstream oss; - oss << status; - std::string ex_mess("Error of connection on remote host ! status = "); - ex_mess += oss.str(); - throw EmulationException(ex_mess.c_str()); - } - } + // Input files copy + exportInputFiles(job); + // Launch job Parametre new_param(param); + new_param[INFILE].eraseAll(); // Patch until Local Manager is patched new_param[OUTFILE].eraseAll(); // Patch until Local Manager is patched Job * j = new Job(new_param); std::cerr << "BatchManager_eSSH::submitJob Local submitJob" << std::endl; -- 2.39.2