string hostname;
//! Type of the resource ("cluster" or "single_machine")
string type;
- //! protocol to connect to the resource
- //! protocol used to start a remote container (ssh or rsh)
+ //! protocol to connect to the resource and to start a remote container
+ //! Possible values:
+ //! "rsh" : uses rsh and rcp
+ //! "ssh" : uses ssh and scp
+ //! "rsync" : uses ssh and rsync
string protocol;
//! login name to use to start a remote container
string username;
std::string local_file;
if (file.substr(0, 1) == std::string("/"))
local_file = file;
+ else if (file.substr(0, 1) == std::string("-")) // using rsync options
+ local_file = file;
else
#ifndef WIN32
- local_file = _local_directory + "/" + file;
+ // '/./' is used by rsync to find the root of the relative path
+ // /a/b/./c/f -> _working_directory/c/f
+ local_file = _local_directory + "/./" + file;
#else
local_file = file;
#endif
// remote file -> get only file name from in_files
- size_t found = file.find_last_of("/");
- std::string remote_file = _work_directory + "/" + file.substr(found+1);
+ std::string remote_file = _work_directory + "/";
params[Batch::INFILE] += Batch::Couple(local_file, remote_file);
}
size_t found = file.find_last_of("/");
local_file = file.substr(found+1);
}
+ else if (file.substr(0, 1) == std::string("-")) // using rsync options
+ {
+ remote_file = file;
+ local_file = "";
+ }
else
{
- remote_file = _work_directory + "/" + file;
- local_file = file;
+ // '/./' is used by rsync to find the root of the relative path
+ remote_file = _work_directory + "/./" + file;
+ local_file = "";
}
params[Batch::OUTFILE] += Batch::Couple(local_file, remote_file);
return "pbsdsh";
case blaunch:
return "blaunch";
+ case rsync:
+ return "rsync";
default:
throw ResourcesException("Unknown protocol");
}
return pbsdsh;
else if (protocolStr == "blaunch")
return blaunch;
+ else if (protocolStr == "rsync")
+ return rsync;
else
throw ResourcesException((string("Unknown protocol ") + protocolStr).c_str());
}
#pragma warning(disable:4251) // Warning DLL Interface ...
#endif
-enum AccessProtocolType {sh, rsh, ssh, srun, pbsdsh, blaunch};
+enum AccessProtocolType {sh, rsh, ssh, srun, pbsdsh, blaunch, rsync};
enum ResourceType {cluster, single_machine};