Monkless has asked for the wisdom of the Perl Monks concerning the following question:
Hello GURU's it has been awhile that I have needed such great direction, but my current issue has me stumped.
I am looking to use Net::SSH::Perl to remote into host and run a wget command to download a package on the remote host in question. I can seem to get all my commands to run on the remote host, but WGET seems to fail:#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use Net::SSH::Perl; my $host = '192.168.x.x'; my $user = 'user'; my $pw = 'pass'; my $ssh = Net::SSH::Perl->new($host); $ssh->login($user, $pw); ## THIS SECTION FAILS ## $ssh->cmd("cd /var/tmp"); $ssh->cmd("wget -c -np -r -nH --cut-dirs=1 --reject \"index.html*\" ht +tp://myURL.com/patch/126546-07/"); ########################
If I run the following, it completes as expected:
$ssh->cmd("cd /var/tmp; hostname > host.dat");If I try the same with ; seperated WGET calls, nothing seems to happen
$ssh->cmd("cd /var/tmp; wget -c -np -r -nH --cut-dirs=1 --reject \"index.html*\" http://myURL.com/patch/126546-07/");The above shows NOTHING in /var/tmp - though I would expect my downloaded DIR to be there.. I have ran the WGET call on host in question to ensure it supports the WGET package and all works well....
Desired output, would be the script changes to the '/var/tmp' DIR on remote host, then completes the package download in /var/tmp so I then can act on the newly downloaded package.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::SSH::Perl and WGET
by Perlbotics (Archbishop) on Jan 12, 2015 at 20:28 UTC | |
by Monkless (Acolyte) on Jan 13, 2015 at 16:55 UTC | |
|
Re: Net::SSH::Perl and WGET
by pme (Monsignor) on Jan 13, 2015 at 08:45 UTC | |
by Monkless (Acolyte) on Jan 13, 2015 at 16:59 UTC | |
by pme (Monsignor) on Jan 13, 2015 at 21:57 UTC | |
by Monkless (Acolyte) on Jan 15, 2015 at 15:23 UTC |