Gridport::FileTransfer
This uses the Gridport::Authentication module...and expects the user to be logged in with
that module and gsi before it will work. This module will complain and then return undef
if you're not logged in properly before attempting to run.
It should also be noted that this module depends on:
-the existence of globus-url-copy exectable on the system
-the Perl CoG's Cog::Globus::Run module
-the Perl CoG's Cog::Globus::RSL module
-the Perl CoG's CogUtil::UnixRun module.
use Gridport::FileTransfer;
my @result = Gridport::FileTransfer::[subroutine(parameters)]
## file transfer using gass get
use Gridport::FileTransfer;
my @get_result = Gridport::FileTransfer::gass_get(
host=>'hostname.organization.edu',
remote_file=>'/path/to/file',
local_file=>'/path/to/file/on/webserver'
);
if(@get_result > 0) {
print "may have been error in gass_get:\n";
foreach(@get_result) {
print; print "\n";
}
}
## file transfer using gass put
my @result = Gridport::FileTransfer::gass_put(
local_file=>'/path/to/file/on/webserver',
remote_file=>'/path/to/file/on/remote resource',
host=>'hostname.organization.edu'
);
if(@result > 0) {
print "result was, \n";
foreach(@result) {
print; print "\n";
}
}
else {
print "file appears to have transferred\n, ok \n";
}
## file tranfer using gridftp put
my @result = Gridport::FileTransfer::gridftp_put(
host=>'hostname.organization.edu',
local_file=>'/path/to/file/on/webserver',
remote_file=>'/path/to/file/on/remote resource',
);
## file transfer using gridftp get
@ouput = Gridport::FileTransfer::gridftp_get(
host=>'hostname.organization.edu',
local_file=>'/path/to/file/on/webserver',
remote_file=>'/path/to/file/on/remote resource',
);
Maytal Dahan, maytal@tacc.utexas.edu Catherine Mills, cmills@sdsc.edu Stephen Mock, mock@sdsc.edu
gass_put()
Description/Usage:
Used to put a file found local to the script running this code, onto a
machine using the globus gass file transfer mechanism.
## file transfer using gass put
my @result = Gridport::FileTransfer::gass_put(
local_file=>'/path/to/file/on/webserver',
remote_file=>'/path/to/file/on/remote resource',
host=>'hostname.organization.edu'
);
Required Arguments:
host - the globus host string
local_file - the file sitting on the local machine here that you wish to
push up to the remote machine
remote_file - the full path to the new file that will be created on the remote host
Optional Arguments:
timeout - the time in seconds until it stops and kills the process
backwards - can be set to 'true' to be backwards compatible with pre globus 2.0 systems.
Returns: an array with the output of the transfer.
If all goes well, this array will be empty.
If not, then it will have globus gibberish in it.
gass_get()
Description/Usage:
Used to pull a file from a remote machine (running globus) back to the local
machine using the globus gass file transfer mechanism.
my @get_result = Gridport::FileTransfer::gass_get(
host=>'hostname.organization.edu',
remote_file=>'/path/to/file',
local_file=>'/path/to/file/on/webserver'
);
Required Arguments:
host - the globus host string
local_file - the full path to the new file on the local host you will
be copying back from the remote machine
remote_file - the full path on the remote machine to the file that you
want to copy
Optional Arguments:
timeout - the time in seconds until it stops and kills the process
backwards - can be set to 'true' to be backwards compatible with pre globus 2.0 systems.
Returns: an array with the output of the transfer.
If all goes well, this array will be empty.
If not, then it will have globus gibberish in it.
gridftp_put()
Description/Usage:
Used to put a file on a remote machine (running gridftp) from local disk
my @result = Gridport::FileTransfer::gridftp_put(
host=>'hostname.organization.edu',
local_file=>'/path/to/file/on/webserver',
remote_file=>'/path/to/file/on/remote resource',
);
Required Arguments:
host - the gridftp host string
local_file - the full path to the existing file on the local host you
will be copying to the remote machine
remote_file - the full path on the remote machine to the file that you want to create
Optional Arguments:
timeout - the time in seconds until it stops and kills the process
Returns: an array with the output of the transfer.
If all goes well, this array will be empty.
If not, then it will have globus gibberish in it.
gridftp_get()
Description/Usage:
Used to get a file from a remote machine (running gridftp) and deposit
it to local disk
my @result = Gridport::FileTransfer::gridftp_put(
host=>'hostname.organization.edu',
local_file=>'/path/to/file/on/webserver',
remote_file=>'/path/to/file/on/remote resource',
);
Required Arguments:
host - the gridftp host string including port if necessary
remote_file - the full path to the file on the remote machine that you want to copy here
local_file - the full path to the file that you want to create locally
Optional Arguments:
timeout - how long in seconds the processes will wait before killing the children
Returns: an array with the output of the transfer.
If all goes well, this array will be empty.
If not, then it will have globus gibberish in it.
gridftp_remote_transfer()
Description/Usage:
Used to perform a 3rd Party Transfer from one remote machine to
another remote machine from a 3rd local machine (here).
@ouput = Gridport::FileTransfer::gridftp_remote_transfer(
source_host=>'source.host.edu',
dest_host=>'dest.host.edu',
source_file=>$full_path_to_file_on_source_remote_system,
dest_file=>$full_path_to_file_on_destination_remote_system
);
Required Arguments:
source_host - the gridftp host string including port if necessary where the source file is located
dest_host - the gridftp host string including port if necessary where the file will be transferred
source_file - the full path to the file on the remote source machine that you want to transfer
dest_file - the full path to the file on the remote destination machine that you want to create
Optional Arguments:
timeout - how long in seconds the processes will wait before killing the children
Returns: an array with the output of the transfer.
If all goes well, this array will be empty.
If not, then it will have globus gibberish in it.
Cog::lib::Cog::Globus::Job, Cog::lib::Cog::Globus::RSL, Cog::lib::Cog::Globus::Run, Cog::lib::Cog::Globus::URLCopy, Cog::lib::Cog::MDS::Search, Cog::lib::Cog::Security::Cacl, Cog::lib::Cog::Security::Myproxy, Cog::lib::Cog::Security::Proxy, Cog::src::Config, CogUtil::lib::CogUtil::Log, CogUtil::lib::CogUtil::UnixRun, Gridport::lib::Gridport::Authentication, Gridport::lib::Gridport::FileTransfer, Gridport::lib::Gridport::Job, Gridport::lib::Gridport::ProxyForward, Gridport::lib::Gridport::SRB, NWS::lib::NWS, SRB::lib::SRB