in reply to Net::SSH::Perl and WGET

Run like this and check the returned values:
my ($out, $err, $exit) = $ssh->cmd("...

Replies are listed 'Best First'.
Re^2: Net::SSH::Perl and WGET
by Monkless (Acolyte) on Jan 13, 2015 at 16:59 UTC

    This may actually be what I need here, as the script downloads now as expected, but script just hangs once download on remote hosts completes.

     my ($out, $stderr3, $exit3,) = $ssh->cmd("/usr/local/bin/wget -c -np -r -nH --cut-dirs=1 --reject index.html* -P /var/tmp 'http://urlHOST/patch/126546-07/'");

    Remote System shows package: co$ ls 126546-07

    Script server shows the script still running, which should have ended after download completed

    $ ./upgradeServices.pl

      What if you add '-v' for verbosity and redirect stdout and stderr into a file on script server?
      my ($out, $stderr3, $exit3,) = $ssh->cmd("/usr/local/bin/wget -v -c -n +p -r -nH --cut-dirs=1 --reject index.html* -P /var/tmp 'http://urlHOS +T/patch/126546-07/' >/var/tmp/download.log 2>&1");
      What can you see in /var/tmp/download.log while the script hangs?

        Again, thanks to all for the input.. I finally realized I was not properly handling my exit code, I was simply expecting the script to finish. Adding the following check now downloads the DIR and moves on to next step of script

        if ($exit3 == 0) { print "Download Completed!\n"; }