running perl script in cron

E

Edward

Can't seem to get this working.


Crontab entry:
55 17 * * * /usr/home/edward/perl/perfanalyser/plTest 2>&1

Script (plTest):
#!/usr/local/bin/perl

open TEST, ">>/usr/home/edward/perl/perfanalyser/test.txt";
print TEST "hello\n";


Cron job fails:
Your "cron" job on ldtcce04
/usr/home/edward/perl/perfanalyser/plTest 2>&1

produced the following output:

ld.so.1: /usr/local/bin/perl: fatal: libgdbm.so.2: open failed: No
such file or directory
Killed


Tried:
55 17 * * * su - edward /usr/home/edward/perl/perfanalyser/plTest 2>&1

Cron job fails:
our "cron" job on ldtcce04
su - edwardo /usr/home/edward/perl/perfanalyser/plTest 2>&1

produced the following output:

/usr/home/edward/perl/perfanalyser/plTest: open: command not found
/usr/home/edward/perl/perfanalyser/plTest: print: command not found

I added to edward's .profile:
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/bin:/usr/ccs/bin
export PATH
LD_LIBRARY_PATH=/usr/local/lib:enfinity0/oracle_client/lib
export LD_LIBRARY_PATH


Any ideas?

Thanks,

Edward
 
W

Walter Roberson

:Can't seem to get this working.



:55 17 * * * /usr/home/edward/perl/perfanalyser/plTest 2>&1

:Cron job fails:
:ld.so.1: /usr/local/bin/perl: fatal: libgdbm.so.2: open failed: No
:such file or directory

:I added to edward's .profile:
:pATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/bin:/usr/ccs/bin
:export PATH
:LD_LIBRARY_PATH=/usr/local/lib:enfinity0/oracle_client/lib
:export LD_LIBRARY_PATH

cron jobs are not interactive jobs, and don't automatically source
your .profile. Try

55 17 * * * . /usr/home/edward/.profile; /usr/home/edward/perl/perfanalyser/plTest 2>&1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top