Trouble running a script with cron

From: Rafael Morales (daredevil_at_bsdmail.com)
Date: 12/29/04

  • Next message: Bob Showalter: "RE: Trouble running a script with cron"
    To: beginners@perl.org
    Date: Thu, 30 Dec 2004 04:21:47 +0800
    
    

    Hi list.

    I need to put a script in cron, but this script needs exec some Oracle variables for work fine, these variables are:
    export ORACLE_HOME=/oracle/app/product/9.2.0
    export ORACLE_SID=galdb
    export LD_LIBRARY_PATH=/oracle/app/product/9.2.0/lib32
    export NLS_LANG='MEXICAN SPANISH_MEXICO.WE8MSWIN1252'
    export NLS_NUMERIC_CHARACTERS='.,'

    However when I try to exec these variables in the script (with "system" or "exec"), does not work well, this a part of my script:

    #!/usr/bin/perl
    use strict;

    system "export ORACLE_HOME=/oracle/app/product/9.2.0";
    system "export ORACLE_SID=galdb";
    system "export LD_LIBRARY_PATH=/oracle/app/product/9.2.0/lib32";
    system "export NLS_LANG=\'MEXICAN SPANISH_MEXICO.WE8MSWIN1252\'";
    system "export NLS_NUMERIC_CHARACTERS=\'.,\'";

    use DBI;
    use DBD::Oracle qw(:ora_types);

    If I run these script manually (without cron) works fine !!!!.
    The error message that I see when run with cron is this:

    Can't load '/usr/local/lib/perl5/site_perl/5.8.2/sun4-solaris/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: ld.so.1: /usr/bin/perl: fatal: /oracle/app/product/9.2.0/lib/libclntsh.so.9.0: wrong ELF class: ELFCLASS64
    at /usr/local/lib/perl5/5.8.2/sun4-solaris/DynaLoader.pm line 229. at /home/horus/SCRIPTS/./estadisticas.pl line 11
    Compilation failed in require at /home/horus/SCRIPTS/./estadisticas.pl line 11.
    BEGIN failed--compilation aborted at /home/horus/SCRIPTS/./estadisticas.pl line 11.

    Regards !!!

    -- 
    _______________________________________________
    Get your free email from http://mymail.bsdmail.com
    Powered by Outblaze
    

  • Next message: Bob Showalter: "RE: Trouble running a script with cron"

    Relevant Pages

    • RE: Trouble running a script with cron
      ... > I need to put a script in cron, but this script needs exec some ... > Oracle variables for work fine, ...
      (perl.beginners)
    • SUMMARY: cron entry: nth day of every month?
      ... cron can not handle this with its own syntax. ... 21st but "command" only runs if the output of the "date" command ... What I would suggest is rather than embedding the logic in each script ... The answer is it is _not_ possible to control it only with crontab ...
      (Tru64-UNIX-Managers)
    • Re: Cron Jobs
      ... > having a cron will mean yo server is forced by the script ... > best than allowing mail dequeing by connection. ... > host server so I can get emails for my domain example.com. ...
      (RedHat)
    • [Solved] Long cronjobs terminate after 2 minutes/Ubuntu 8.10
      ... When I run the script in the foreground, it takes about 2 hours to ... Have you got your system set up so that cron sends mail to ... I configured Postfix for local mail only and updated ... I'm assuming that configuring the MTA is what did it. ...
      (Ubuntu)
    • Re: Silent Cron Jobs
      ... afaik cron mails all output from a script. ... cronjob I usually dump all stdout ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
      (Debian-User)