pinnacle has asked for the wisdom of the Perl Monks concerning the following question:
When I run my script on commandline it works fine, but through cron it displays error:
mkdir //.ssh: Permission denied at /usr/lib/perl5/vendor_perl/5.8.5/Net/SSH/Perl/Util/Hosts.pm line 92
I am using module Net::SSH::Perl in my perl script
use Net::SSH::Perl; $pac = burn.i386_26.rpm $host = "10.x.x.x"; $user = "xxxxx"; $passwd = "xxxxx"; $cmd = <<COM; cd /usr rpm -ivh $pac COM $ssh = Net::SSH::Perl->new($host); $ssh->login($user,$passwd); ($output, $error, $exit) = $ssh->cmd($cmd); $cmd = <<CC; cd /usr rm -rf $pac CC $ssh = Net::SSH::Perl->new($host); $ssh->login($user,$passwd); ($output, $error, $exit) = $ssh->cmd($cmd);
Please assist, thanks!!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Script running through cron throwing error else works fine
by aaron_baugher (Curate) on Apr 25, 2012 at 00:35 UTC | |
by pinnacle (Acolyte) on Apr 25, 2012 at 19:00 UTC | |
|
Re: Script running through cron throwing error else works fine
by rovf (Priest) on Apr 25, 2012 at 08:47 UTC |