CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: DBI:
DBD::ODBC runs manually, not via crontab

 



islanderman
Novice

May 5, 2014, 8:01 AM

Post #1 of 2 (75615 views)
DBD::ODBC runs manually, not via crontab Can't Post

I installed DBD::ODBC and everything runs fine from a non-root account via command line, but just not via crontab. The module is located here:

/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/DBD/ODBC.pm

I ran a crontab entry to capture the perl libraries from the account and I see the path :

/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8
/usr/lib/perl5/site_perl
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8
/usr/lib/perl5/vendor_perl
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/5.8.8


Can someone help with what I'm missing, or help capturing what the error actually is? I am not even doing anything, like connecting to a DB. I just am running a bare bones perl script with the 'use DBD::ODBC' in it.


Laurent_R
Veteran / Moderator

May 5, 2014, 11:42 PM

Post #2 of 2 (75316 views)
Re: [islanderman] DBD::ODBC runs manually, not via crontab [In reply to] Can't Post

I had a similar problem with an Oracle database: the script would run fine when launched manually from my account but would fail when launched vie the crontab. It turned out that the problem did not have to do with Perl (I reproduced it with a shell script and sqlplus commands), but with some environment variables needed to be able to connect to the Oracle database, which were not set for the root account. You might have a similar problem.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives