Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004

    Unanswered: cron jobs and perl

    hello all

    i have a perl script that runs db backups on sybase. when i run this directly from the command line, it works fine. when i set up a cron job it brings back the error "ct_init(): network packet layer: internal net library error: Attempt to load protocol driver failed". it's not a problem with the library path(s) as as i mentioned, from the command line the scrip works fine. could anyone enlighten me as to how cron works (i.e. when it's run is it run in the user mode of the owner of the crontab file??) as i'm thinking it's some sort or permissions issue but can't see how to resolve it without knowing how cron works.

    cheers for any help in advance

  2. #2
    Join Date
    Dec 2002
    Bathurst Australia
    It sounds like you've got a seperate location for storing modules, specifically the DBI drivers (DBD). Try this:

    $ set | grep PERL

    That will show any environment variables used by the perl interpreter. Look out for PERL5LIB for anything that looks like a PATH list e.g PERL5LIB=/some/dir:/other/dir:/opt/some/dir
    If that's set then it's probably not being set when Cron runs your script. You'll have to change your crontab line:

    0 * * * * * PERL5LIB=/blah /home/bloggs/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts