Proc::JobQueue::Move - move files from one place to another
use Proc::JobQueue::BackgroundQueue; use aliased 'Proc::JobQueue::Command'; my $queue = new Proc::JobQueue::BackgroundQueue; use aliased 'Proc::JobQueue::Move'; my $job = Move->new($opts, $config, $from_file, $to_file, $to_host, $from_host); $queue->add($job); $queue->finish;
This is a subclass of Proc::JobQueue::Job. In the background, move a file to a new location (possibly on a new host).
scp will be used to move files to remote locations. The trust relationships must already exist. Files will be compressed in transit if $config-{compress_network_copies}> is true.
scp
$config-
Only one copy job per destination host is allowed to run simultaneously.
If the $to_host matches Sys::Hostname::hostname then the mv command will be used instead of scp and rm.
$to_host
Sys::Hostname::hostname
mv
rm
The $opts parameter is not currently used. The $config parameter must be a hash ref and the following keys are checked:
$opts
$config
If true, will add -C to the invocation of scp.
-C
The rest of the parameters are self-explanatory. The from_host parameter defaults to the local system. So does the to_host parameter.
from_host
to_host
The argument order for the constructor doesn't make any sense. Sorry.
Either the from_host or the to_host needs to be the local host.
Proc::JobQueue Proc::JobQueue::Job Proc::JobQueue::BackgroundQueue
Copyright (C) 2007-2008 SearchMe, Inc. Copyright (C) 2008-2010 David Sharnoff. Copyright (C) 2011 Google, Inc. This package may be used and redistributed under the terms of either the Artistic 2.0 or LGPL 2.1 license.
To install Proc::JobQueue, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Proc::JobQueue
CPAN shell
perl -MCPAN -e shell install Proc::JobQueue
For more information on module installation, please visit the detailed CPAN module installation guide.