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.
In reply to Net::SSH::Perl and WGET by Monkless
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |