1

Topic: perl sqlplus cron

Greetings!
What that the strange problem with a pearl-barley script, all normally works at start from the terminal, and at start from crones that that not that with a part where  an exterior command sqlplus and the silence, any error reports.
Script such:

open (in, "start.txt");
my $startname = <in>;
$startname = ~ s/\W//g;
print $startname, "\n";
$startname = ~ / (\d +)/;
$cnt = $1;
$cnt;
print "$cnt\n";
$fld = $ file = $ startname;
print $fld, $file;
##############ORACLE######################
$ftp = Net:: FTP-> new ("ftp.ed-admin.com") || die "nono";
$ftp-> login (....);
print $ftp-> ls ();
$ftp-> cwd ("$fld") or die "Cannot change working directory to $fld\n";
print $ftp-> pwd ();
$ftp-> binary ();
$ftp-> get ("$file.sql");
open (out, ">start.txt");
print out "update". "$cnt\n";
my $out=system ("sqlplus updaterepo/update123@XE $file.sql;");
print $out;

2

Re: perl sqlplus cron

At a crone in a surrounding it is a lot of that not how in the console. Try to specify to begin with a full path to a command. Or in PATH in a crone to specify search ways as in the console.

3

Re: perl sqlplus cron

I and a surrounding  in a command a crone, the same bash_profile under which in manual all am normal.

4

Re: perl sqlplus cron

Well and at return code after a call to look, a flow of errors?

5

Re: perl sqlplus cron

vkle wrote:

Well and return code after a call to look, a flow of errors?

Here about stderr I also forgot and in the remaining is empty.

6

Re: perl sqlplus cron

Jebrail;
And in stderr it is empty? And return code? , it is possible in echo and >file.log to frame a command, can, somehow not so the team text is formed. In an adjacent forum recently there was a topic about is made not clear behavior in a script on a crone.

7

Re: perl sqlplus cron

Return code good =0.
But all the same it was necessary to write   on  and already it to cause,   here such it turned out.

sqlplus / as sysdba <<EOF
set timing on;
select to_char (sysdate, ' dd/mm/yy hh24:mi:ss') from dual;
spool $1.log;
set serveroutput on;
@$1;
EOF
$sql = `./run.sh "$f" `;
print "$sql\n";
}