[tpm] Net::SCP and Net::SFTP modules

Richard Dice rdice at pobox.com
Sun Nov 9 16:10:30 PST 2008


On Sun, Nov 9, 2008 at 6:23 PM, Henry Baragar <Henry.Baragar at instantiated.ca
> wrote:

> I have been trying to use Net::SFTP:  it works when I run the application
> from
> the shell, but not under cron!
>

Cron as your user, or cron as the system cron?

cron provides a huge dearth of environment variables and other things that
might be set up by your .login or .bashrc file.  My guess is that there is
something being provided by an envvar, shell alias, _something_ in your
personal environment that your Perl program somehow depends upon.  Or it
might be something as simple as directory permissions and how they apply in
the context of the system cron user.  (might be root, might be cron, might
be something else)

That debugging message hardly seems helpful, as it is telling where in the
stack of depended-upon modules the failure occurs at.  You should build some
debugging / error trapping (eval) code around each line in your subroutine
there to see where the failure actually occurs at from the perspective of
your program.  From there you can try to figure out how it is different when
run as yourself and when run as cron.

Cheers,
 - Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20081109/4c19a4b0/attachment-0001.html>


More information about the toronto-pm mailing list