in reply to Re^2: Sending & Executing a perl script on remote machine.
in thread Sending & Executing a perl script on remote machine.
That would allow to maintain a library of perl modules and scripts replicated across all your servers, though it needs the rsync binary installed on them!
use Net::OpenSSH::Parallel; my $p = Net::OpenSSH::Parallel->new; $p->add_host($_) for @hosts; $p->push('*', 'rsync_put', { recurse => 1 }, '/my/local/perl/library', '/tmp/my-perl'); $p->push('*', 'command', { stdout_file => '%HOST.out', stderr_file => '%HOST.err' }, '/usr/bin/perl -I/tmp/my-perl/lib /tmp/my-perl/script.pl +'); $p->run or die "something failed!"
|
|---|