Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Postgres error when calling from a cron file

Status
Not open for further replies.

kungphu

Programmer
Joined
May 23, 2006
Messages
13
Location
GB
Hi guys

I am running a cron file which calls a perl script. When I run the perl script from the command line it executes with no errors. But when postgres runs the cron file it gets an error.
This is what my cron file looks like when it calls the perl file

Code:
10 * * * * root /folderpath/file.pl

The output i get from the webmin interface is
Code:
Output from command /filepath/file.pl ..

install_driver(Pg) failed: Can't load '/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBD/Pg/Pg.so' for module DBD::Pg: libpq.so.4: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230.
 at (eval 4) line 3
Compilation failed in require at (eval 4) line 3.
Perhaps a required shared library or dll isn't installed where expected
 at /filepath/file.pl line 15

I am pretty certain that there isnt a problem with my perl code, just a problem with the cron file.

Any help is greatly appreciated

Kungphu
 
Sounds like a permissions problem. Does the user Postgres runs as on the machine have access to execute perl?

- George
 
when i changed my cron file to
Code:
10 * * * * postgres /folderpath/file.pl

I got an access denied message
 
I managed to sort out the above problem,

i went to the etc folder and then edited the ld.so.conf file by adding the line
/usr/local/pgsql/lib
Then i saved the file. Then went back to the shell window and typed
Code:
ldconfig
and pressed enter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top